Patchwork [02/12] ide: Remove cast in pci_register_bar

login
register
mail settings
Submitter Juan Quintela
Date Oct. 7, 2009, 2:56 p.m.
Message ID <d28189b21154fe9a75b8270cb04e8229a5dc00d3.1254927186.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/35296/
State Under Review
Headers show

Comments

Juan Quintela - Oct. 7, 2009, 2:56 p.m.
We already have a PCIDevice at that point

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/ide/pci.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

Patch

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 0e2c7d7..9d7fdd4 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -413,16 +413,11 @@  static int pci_cmd646_ide_initfn(PCIDevice *dev)
         pci_conf[0x51] |= 0x08; /* enable IDE1 */
     }

-    pci_register_bar((PCIDevice *)d, 0, 0x8,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 1, 0x4,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 2, 0x8,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 3, 0x4,
-                     PCI_ADDRESS_SPACE_IO, ide_map);
-    pci_register_bar((PCIDevice *)d, 4, 0x10,
-                     PCI_ADDRESS_SPACE_IO, bmdma_map);
+    pci_register_bar(dev, 0, 0x8, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 1, 0x4, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 2, 0x8, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 3, 0x4, PCI_ADDRESS_SPACE_IO, ide_map);
+    pci_register_bar(dev, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map);

     pci_conf[0x3d] = 0x01; // interrupt on pin 1

@@ -477,8 +472,7 @@  static int pci_piix_ide_initfn(PCIIDEState *d)
     qemu_register_reset(piix3_reset, d);
     piix3_reset(d);

-    pci_register_bar((PCIDevice *)d, 4, 0x10,
-                     PCI_ADDRESS_SPACE_IO, bmdma_map);
+    pci_register_bar(&d->dev, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map);

     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);