From patchwork Wed May 22 05:33:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 245509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C4432C00A4 for ; Wed, 22 May 2013 15:35:01 +1000 (EST) Received: from localhost ([::1]:60876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1hT-0002S0-N5 for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 01:34:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1gs-0002Ra-5w for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf1gn-0008UF-9Q for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:22 -0400 Received: from [222.73.24.84] (port=12267 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1gm-0008RJ-TD for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:17 -0400 X-IronPort-AV: E=Sophos;i="4.87,719,1363104000"; d="scan'208";a="7330817" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 22 May 2013 13:31:11 +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 r4M5Y0wd022008; Wed, 22 May 2013 13:34:00 +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 2013052213324189-1422179 ; Wed, 22 May 2013 13:32:41 +0800 From: Hu Tao To: qemu-devel@nongnu.org Date: Wed, 22 May 2013 13:33:05 +0800 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 13:32:42, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 13:32:43, Serialize complete at 2013/05/22 13:32:43 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: Vasilis Liaskovitis , Jan Kiszka , Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Wanpeng Li Subject: [Qemu-devel] [RFC PATCH v1 01/20] 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 43ab480..8c9ea6f 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 2bd7090..e2f6717 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -122,7 +122,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,