From dc5d0b9a8e1020be3bd3dd22f20d869db30e1b8c Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Mon, 24 Aug 2009 18:42:42 +0200 Subject: lsi53c895a: use DO_UPCAST to cast from PCIDevice Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- hw/lsi53c895a.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw') diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 6f872f1..6ef9abf 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1927,7 +1927,7 @@ static void lsi_io_writel(void *opaque, uint32_t addr, uint32_t val) static void lsi_io_mapfunc(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { - LSIState *s = (LSIState *)pci_dev; + LSIState *s = DO_UPCAST(LSIState, pci_dev, pci_dev); DPRINTF("Mapping IO at %08x\n", addr); @@ -1942,7 +1942,7 @@ static void lsi_io_mapfunc(PCIDevice *pci_dev, int region_num, static void lsi_ram_mapfunc(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { - LSIState *s = (LSIState *)pci_dev; + LSIState *s = DO_UPCAST(LSIState, pci_dev, pci_dev); DPRINTF("Mapping ram at %08x\n", addr); s->script_ram_base = addr; @@ -1952,7 +1952,7 @@ static void lsi_ram_mapfunc(PCIDevice *pci_dev, int region_num, static void lsi_mmio_mapfunc(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { - LSIState *s = (LSIState *)pci_dev; + LSIState *s = DO_UPCAST(LSIState, pci_dev, pci_dev); DPRINTF("Mapping registers at %08x\n", addr); cpu_register_physical_memory(addr + 0, 0x400, s->mmio_io_addr); @@ -2153,7 +2153,7 @@ static int lsi_scsi_load(QEMUFile *f, void *opaque, int version_id) static int lsi_scsi_uninit(PCIDevice *d) { - LSIState *s = (LSIState *) d; + LSIState *s = DO_UPCAST(LSIState, pci_dev, d); cpu_unregister_io_memory(s->mmio_io_addr); cpu_unregister_io_memory(s->ram_io_addr); @@ -2165,7 +2165,7 @@ static int lsi_scsi_uninit(PCIDevice *d) static int lsi_scsi_init(PCIDevice *dev) { - LSIState *s = (LSIState *)dev; + LSIState *s = DO_UPCAST(LSIState, pci_dev, dev); uint8_t *pci_conf; pci_conf = s->pci_dev.config; -- cgit v1.1