Patchwork [01/12] ide: change cast to DO_UPCAST

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

Comments

Juan Quintela - Oct. 7, 2009, 2:56 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/ide/pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 6d090bc..0e2c7d7 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++) {