diff mbox

device-assignment: cleanup assigned_dev_ioport_map

Message ID 4CB569C0.6020905@jp.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hidetoshi Seto Oct. 13, 2010, 8:11 a.m. UTC
None
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 26cb797..975bf29 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -324,18 +324,12 @@  static void assigned_dev_ioport_map(PCIDevice *pci_dev, int region_num,
 	    kvm_ioperm(env, data);
     }
 
-    register_ioport_read(addr, size, 1, assigned_dev_ioport_readb,
-                         (r_dev->v_addrs + region_num));
-    register_ioport_read(addr, size, 2, assigned_dev_ioport_readw,
-                         (r_dev->v_addrs + region_num));
-    register_ioport_read(addr, size, 4, assigned_dev_ioport_readl,
-                         (r_dev->v_addrs + region_num));
-    register_ioport_write(addr, size, 1, assigned_dev_ioport_writeb,
-                          (r_dev->v_addrs + region_num));
-    register_ioport_write(addr, size, 2, assigned_dev_ioport_writew,
-                          (r_dev->v_addrs + region_num));
-    register_ioport_write(addr, size, 4, assigned_dev_ioport_writel,
-                          (r_dev->v_addrs + region_num));
+    register_ioport_read(addr, size, 1, assigned_dev_ioport_readb, region);
+    register_ioport_read(addr, size, 2, assigned_dev_ioport_readw, region);
+    register_ioport_read(addr, size, 4, assigned_dev_ioport_readl, region);
+    register_ioport_write(addr, size, 1, assigned_dev_ioport_writeb, region);
+    register_ioport_write(addr, size, 2, assigned_dev_ioport_writew, region);
+    register_ioport_write(addr, size, 4, assigned_dev_ioport_writel, region);
 }
 
 static uint32_t assigned_dev_pci_read(PCIDevice *d, int pos, int len)