summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-24 18:43:00 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:47:01 -0500
commit7d9e52bd70c0df69f0eb6a91bc26a158356abf5d (patch)
tree87196c892006d048273b79a964eafefb85dc93c0 /hw
parent0abaa7c1006d0d21c7ef4dfb8af11f9b06e645d4 (diff)
downloadhqemu-7d9e52bd70c0df69f0eb6a91bc26a158356abf5d.zip
hqemu-7d9e52bd70c0df69f0eb6a91bc26a158356abf5d.tar.gz
e1000 cleanup
Remove un needed casts from void *. Use DO_UPCAST() instead of blind casts Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/e1000.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/e1000.c b/hw/e1000.c
index 0253d3b..95c471c 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -897,7 +897,7 @@ enum { MAC_NARRAYS = ARRAY_SIZE(mac_regarraystosave) };
static void
nic_save(QEMUFile *f, void *opaque)
{
- E1000State *s = (E1000State *)opaque;
+ E1000State *s = opaque;
int i, j;
pci_device_save(&s->dev, f);
@@ -940,7 +940,7 @@ nic_save(QEMUFile *f, void *opaque)
static int
nic_load(QEMUFile *f, void *opaque, int version_id)
{
- E1000State *s = (E1000State *)opaque;
+ E1000State *s = opaque;
int i, j, ret;
if ((ret = pci_device_load(&s->dev, f)) < 0)
@@ -1032,7 +1032,7 @@ static void
e1000_mmio_map(PCIDevice *pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
- E1000State *d = (E1000State *)pci_dev;
+ E1000State *d = DO_UPCAST(E1000State, dev, pci_dev);
int i;
const uint32_t excluded_regs[] = {
E1000_MDIC, E1000_ICR, E1000_ICS, E1000_IMS,
@@ -1062,7 +1062,7 @@ e1000_cleanup(VLANClientState *vc)
static int
pci_e1000_uninit(PCIDevice *dev)
{
- E1000State *d = (E1000State *) dev;
+ E1000State *d = DO_UPCAST(E1000State, dev, dev);
cpu_unregister_io_memory(d->mmio_index);
@@ -1083,7 +1083,7 @@ static void e1000_reset(void *opaque)
static int pci_e1000_init(PCIDevice *pci_dev)
{
- E1000State *d = (E1000State *)pci_dev;
+ E1000State *d = DO_UPCAST(E1000State, dev, pci_dev);
uint8_t *pci_conf;
uint16_t checksum = 0;
static const char info_str[] = "e1000";
OpenPOWER on IntegriCloud