qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 61073e0] ide: change cast to DO_UPCAST


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 61073e0] ide: change cast to DO_UPCAST
Date: Mon, 12 Oct 2009 15:19:15 -0000

From: Juan Quintela <address@hidden>

Patchworks-ID: 35293
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 9504e44..81bc6a7 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -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++) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]