aboutsummaryrefslogtreecommitdiff
path: root/hw/pcnet.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-24 18:42:57 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:47:00 -0500
commit1f235a737bb26486cafcb106fa3aa531a407a6c3 (patch)
tree8bef06a1f9251fc37cac90ad680bf41a333fd1ac /hw/pcnet.c
parent4f335febba2fb237194007ce4906fc78aa998c82 (diff)
pcnet: Change casts to DO_UPCAST() for PCIPCNetState
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pcnet.c')
-rw-r--r--hw/pcnet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 107b5b64c3..9bcd3ccff9 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -1764,7 +1764,7 @@ static uint32_t pcnet_ioport_readl(void *opaque, uint32_t addr)
static void pcnet_ioport_map(PCIDevice *pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
- PCNetState *d = &((PCIPCNetState *)pci_dev)->state;
+ PCNetState *d = &DO_UPCAST(PCIPCNetState, pci_dev, pci_dev)->state;
#ifdef PCNET_DEBUG_IO
printf("pcnet_ioport_map addr=0x%04x size=0x%04x\n", addr, size);
@@ -1979,7 +1979,7 @@ static CPUReadMemoryFunc * const pcnet_mmio_read[] = {
static void pcnet_mmio_map(PCIDevice *pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
- PCIPCNetState *d = (PCIPCNetState *)pci_dev;
+ PCIPCNetState *d = DO_UPCAST(PCIPCNetState, pci_dev, pci_dev);
#ifdef PCNET_DEBUG_IO
printf("pcnet_mmio_map addr=0x%08x 0x%08x\n", addr, size);
@@ -2009,7 +2009,7 @@ static void pci_pcnet_cleanup(VLANClientState *vc)
static int pci_pcnet_uninit(PCIDevice *dev)
{
- PCIPCNetState *d = (PCIPCNetState *)dev;
+ PCIPCNetState *d = DO_UPCAST(PCIPCNetState, pci_dev, dev);
cpu_unregister_io_memory(d->state.mmio_index);
@@ -2018,7 +2018,7 @@ static int pci_pcnet_uninit(PCIDevice *dev)
static int pci_pcnet_init(PCIDevice *pci_dev)
{
- PCIPCNetState *d = (PCIPCNetState *)pci_dev;
+ PCIPCNetState *d = DO_UPCAST(PCIPCNetState, pci_dev, pci_dev);
PCNetState *s = &d->state;
uint8_t *pci_conf;