From patchwork Mon Aug 24 16:43:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 2E167B7B69 for ; Tue, 25 Aug 2009 03:53:42 +1000 (EST) Received: from localhost ([127.0.0.1]:53279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfdjf-0007i7-9b for incoming@patchwork.ozlabs.org; Mon, 24 Aug 2009 13:53:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfcgC-0001Ra-Gd for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:46:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfcg7-0001K2-I5 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:59 -0400 Received: from [199.232.76.173] (port=33832 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfcg7-0001Jl-CX for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58551) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mfcg6-00038l-Pg for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:55 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjru0018350 for ; Mon, 24 Aug 2009 12:45:54 -0400 Received: from localhost.localdomain (vpn1-4-157.ams2.redhat.com [10.36.4.157]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjKUI024317; Mon, 24 Aug 2009 12:45:52 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 Aug 2009 18:43:00 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 26/26] e1000 cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove un needed casts from void *. Use DO_UPCAST() instead of blind casts Signed-off-by: Juan Quintela --- 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";