qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] e100 cleanup
@ 2009-08-21 12:57 Juan Quintela
  2009-08-21 13:08 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Juan Quintela @ 2009-08-21 12:57 UTC (permalink / raw)
  To: qemu-devel

Remove un needed casts from void *.
Use DO_UPCAST() instead of blind casts

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/e1000.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index b0542d7..85cfbb0 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 void 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";
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] e100 cleanup
  2009-08-21 12:57 [Qemu-devel] [PATCH] e100 cleanup Juan Quintela
@ 2009-08-21 13:08 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2009-08-21 13:08 UTC (permalink / raw)
  To: Juan Quintela; +Cc: qemu-devel

On 08/21/09 14:57, Juan Quintela wrote:
> Remove un needed casts from void *.
> Use DO_UPCAST() instead of blind casts

Looks good.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-21 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-21 12:57 [Qemu-devel] [PATCH] e100 cleanup Juan Quintela
2009-08-21 13:08 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).