From patchwork Thu Jun 20 10:15:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 252845 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 354C42C029E for ; Thu, 20 Jun 2013 20:17:49 +1000 (EST) Received: from localhost ([::1]:58325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upbw2-000750-RI for incoming@patchwork.ozlabs.org; Thu, 20 Jun 2013 06:17:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpbvR-0006zI-Cl for qemu-devel@nongnu.org; Thu, 20 Jun 2013 06:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpbvQ-0000fT-37 for qemu-devel@nongnu.org; Thu, 20 Jun 2013 06:17:09 -0400 Received: from [222.73.24.84] (port=20431 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpbvP-00006J-Gw for qemu-devel@nongnu.org; Thu, 20 Jun 2013 06:17:08 -0400 X-IronPort-AV: E=Sophos;i="4.87,903,1363104000"; d="scan'208";a="7614694" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 20 Jun 2013 18:13:10 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r5KAG4Rs006750 for ; Thu, 20 Jun 2013 18:16:04 +0800 Received: from G08FNSTD100614.fnst.cn.fujitsu.com ([10.167.233.156]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013062018145853-2329245 ; Thu, 20 Jun 2013 18:14:58 +0800 From: Hu Tao To: qemu-devel@nongnu.org Date: Thu, 20 Jun 2013 18:15:00 +0800 Message-Id: <5c415473a26979a1dfd777888c2508b9b40b528b.1371721792.git.hutao@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/20 18:14:58, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/20 18:14:58, Serialize complete at 2013/06/20 18:14:58 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Subject: [Qemu-devel] [PATCH RFC 01/15] i440fx: remove unused parameter i440fx_state of i440fx_init. 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 Signed-off-by: Hu Tao --- hw/i386/pc_piix.c | 4 +--- hw/pci-host/piix.c | 10 ++++------ include/hw/i386/pc.h | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 97362f2..1e83c1c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -74,7 +74,6 @@ static void pc_init1(MemoryRegion *system_memory, ram_addr_t below_4g_mem_size, above_4g_mem_size; PCIBus *pci_bus; ISABus *isa_bus; - PCII440FXState *i440fx_state; int piix3_devfn = -1; qemu_irq *cpu_irq; qemu_irq *gsi; @@ -137,7 +136,7 @@ static void pc_init1(MemoryRegion *system_memory, } if (pci_enabled) { - pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi, + pci_bus = i440fx_init(&piix3_devfn, &isa_bus, gsi, system_memory, system_io, ram_size, below_4g_mem_size, 0x100000000ULL - below_4g_mem_size, @@ -148,7 +147,6 @@ static void pc_init1(MemoryRegion *system_memory, pci_memory, ram_memory); } else { pci_bus = NULL; - i440fx_state = NULL; isa_bus = isa_bus_new(NULL, system_io); no_hpet = 1; } diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index f9e68c3..0176ae9 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -225,7 +225,6 @@ static int i440fx_initfn(PCIDevice *dev) } static PCIBus *i440fx_common_init(const char *device_name, - PCII440FXState **pi440fx_state, int *piix3_devfn, ISABus **isa_bus, qemu_irq *pic, MemoryRegion *address_space_mem, @@ -255,8 +254,7 @@ static PCIBus *i440fx_common_init(const char *device_name, qdev_init_nofail(dev); d = pci_create_simple(b, 0, device_name); - *pi440fx_state = I440FX_PCI_DEVICE(d); - f = *pi440fx_state; + f = I440FX_PCI_DEVICE(d); f->system_memory = address_space_mem; f->pci_address_space = pci_address_space; f->ram_memory = ram_memory; @@ -307,14 +305,14 @@ static PCIBus *i440fx_common_init(const char *device_name, ram_size = ram_size / 8 / 1024 / 1024; if (ram_size > 255) ram_size = 255; - (*pi440fx_state)->dev.config[0x57]=ram_size; + f->dev.config[0x57] = ram_size; i440fx_update_memory_mappings(f); return b; } -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, +PCIBus *i440fx_init(int *piix3_devfn, ISABus **isa_bus, qemu_irq *pic, MemoryRegion *address_space_mem, MemoryRegion *address_space_io, @@ -328,7 +326,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, { PCIBus *b; - b = i440fx_common_init(TYPE_I440FX_PCI_DEVICE, pi440fx_state, + b = i440fx_common_init(TYPE_I440FX_PCI_DEVICE, piix3_devfn, isa_bus, pic, address_space_mem, address_space_io, ram_size, pci_hole_start, pci_hole_size, diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 7f04967..7c95189 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -126,7 +126,7 @@ extern int no_hpet; struct PCII440FXState; typedef struct PCII440FXState PCII440FXState; -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, +PCIBus *i440fx_init(int *piix_devfn, ISABus **isa_bus, qemu_irq *pic, MemoryRegion *address_space_mem, MemoryRegion *address_space_io,