From patchwork Sun Jul 7 23:05:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 257440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 19B032C00A1 for ; Mon, 8 Jul 2013 09:05:32 +1000 (EST) Received: from localhost ([::1]:35189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvy1J-0004iR-Go for incoming@patchwork.ozlabs.org; Sun, 07 Jul 2013 19:05:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvy0x-0004d3-Br for qemu-devel@nongnu.org; Sun, 07 Jul 2013 19:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uvy0w-0003ke-0y for qemu-devel@nongnu.org; Sun, 07 Jul 2013 19:05:07 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35574 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvy0v-0003iM-Nx for qemu-devel@nongnu.org; Sun, 07 Jul 2013 19:05:05 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A33B1A50DE; Mon, 8 Jul 2013 01:05:04 +0200 (CEST) Message-ID: <51D9F41C.4000200@suse.de> Date: Mon, 08 Jul 2013 01:05:00 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= Organization: SUSE LINUX Products GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Hu Tao References: <7bdbde3da2d08d4971bdf3b3e07ba0815d1e98b3.1372673778.git.hutao@cn.fujitsu.com> In-Reply-To: <7bdbde3da2d08d4971bdf3b3e07ba0815d1e98b3.1372673778.git.hutao@cn.fujitsu.com> X-Enigmail-Version: 1.6a1pre X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: qemu-devel Subject: Re: [Qemu-devel] [PATCH v2 06/26] q35: use type-safe cast instead of directly access of parent dev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 01.07.2013 12:18, schrieb Hu Tao: > And remove variables if possible. > > Signed-off-by: Hu Tao > --- > hw/pci-host/q35.c | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) Thanks, converted the remaining ones as attached and queued on qom-next: https://github.com/afaerber/qemu-cpu/commits/qom-next Do note that we will need to later touch the PCIBus again to use pci_bus_new_inplace(). Andreas diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 480d981..bdac09e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -59,7 +59,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) const char *boot_device = args->boot_device; ram_addr_t below_4g_mem_size, above_4g_mem_size; Q35PCIHost *q35_host; - PCIDevice *q35_pci; + PCIHostState *phb; PCIBus *host_bus; PCIDevice *lpc; BusState *idebus[MAX_SATA_PORTS]; @@ -134,8 +134,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args) q35_host->mch.above_4g_mem_size = above_4g_mem_size; /* pci */ qdev_init_nofail(DEVICE(q35_host)); - q35_pci = PCI_DEVICE(q35_host); - host_bus = q35_pci->bus; + phb = PCI_HOST_BRIDGE(q35_host); + host_bus = phb->bus; /* create ISA bus */ lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true,