From patchwork Mon Aug 24 16:42:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31978 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 AF883B7B6B for ; Tue, 25 Aug 2009 03:27:42 +1000 (EST) Received: from localhost ([127.0.0.1]:42367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfdKV-0004Ow-O8 for incoming@patchwork.ozlabs.org; Mon, 24 Aug 2009 13:27:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mfcfy-00017y-6b for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfcfs-0000zT-PO for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:45 -0400 Received: from [199.232.76.173] (port=33817 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfcfs-0000yw-H3 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43117) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mfcfr-00035Z-SR for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:40 -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 n7OGjcVi019710 for ; Mon, 24 Aug 2009 12:45:39 -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 n7OGjKU6024317; Mon, 24 Aug 2009 12:45:38 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 Aug 2009 18:42:48 +0200 Message-Id: <2363612038057bcd1cedd9a7a2a518b410746d06.1251131364.git.quintela@redhat.com> 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 14/26] usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState 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 Signed-off-by: Juan Quintela --- hw/usb-ohci.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index 4c42ec0..fbebf1d 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -1706,7 +1706,7 @@ typedef struct { static void ohci_mapfunc(PCIDevice *pci_dev, int i, uint32_t addr, uint32_t size, int type) { - OHCIPCIState *ohci = (OHCIPCIState *)pci_dev; + OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, pci_dev); cpu_register_physical_memory(addr, size, ohci->state.mem); } @@ -1714,8 +1714,9 @@ void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn) { OHCIPCIState *ohci; - ohci = (OHCIPCIState *)pci_register_device(bus, "OHCI USB", sizeof(*ohci), - devfn, NULL, NULL); + ohci = DO_UPCAST(OHCIPCIState, pci_dev, + pci_register_device(bus, "OHCI USB", sizeof(*ohci), + devfn, NULL, NULL)); if (ohci == NULL) { fprintf(stderr, "usb-ohci: Failed to register PCI device\n"); return;