ide: change cast to DO_UPCAST
authorJuan Quintela <quintela@redhat.com>
Wed, 7 Oct 2009 14:56:18 +0000 (16:56 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 12 Oct 2009 14:42:30 +0000 (09:42 -0500)
Patchworks-ID: 35293
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/pci.c

index 9504e4457eb57172cf1f98d1921a9d8d5b50cf55..81bc6a737b5048bdcfccd406a8bf83578a3a922e 100644 (file)
@@ -62,7 +62,7 @@ static void cmd646_update_irq(PCIIDEState *d);
 static void ide_map(PCIDevice *pci_dev, int region_num,
                     uint32_t addr, uint32_t size, int type)
 {
-    PCIIDEState *d = (PCIIDEState *)pci_dev;
+    PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, pci_dev);
     IDEBus *bus;
 
     if (region_num <= 3) {
@@ -247,7 +247,7 @@ static void bmdma_addr_writel(void *opaque, uint32_t addr, uint32_t val)
 static void bmdma_map(PCIDevice *pci_dev, int region_num,
                     uint32_t addr, uint32_t size, int type)
 {
-    PCIIDEState *d = (PCIIDEState *)pci_dev;
+    PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, pci_dev);
     int i;
 
     for(i = 0;i < 2; i++) {