From patchwork Wed Oct 24 17:49:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 193891 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 BDB862C00F3 for ; Thu, 25 Oct 2012 04:55:34 +1100 (EST) Received: from localhost ([::1]:39127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR5Ay-0006Iu-Re for incoming@patchwork.ozlabs.org; Wed, 24 Oct 2012 13:55:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR5AA-0004Zq-5H for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR5A4-000559-7k for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:54:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR5A3-00054k-U2 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 13:54:36 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9OHsYOD030774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Oct 2012 13:54:35 -0400 Received: from blackpad.lan.raisama.net (vpn1-4-109.gru2.redhat.com [10.97.4.109]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9OHmcHY010756; Wed, 24 Oct 2012 13:48:38 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 32AB82031C2; Wed, 24 Oct 2012 15:50:08 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 24 Oct 2012 15:49:42 -0200 Message-Id: <1351101001-14589-9-git-send-email-ehabkost@redhat.com> In-Reply-To: <1351101001-14589-1-git-send-email-ehabkost@redhat.com> References: <1351101001-14589-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paolo Bonzini Subject: [Qemu-devel] [PATCH 08/27] pc: pc_init1(): remove MemoryRegion arguments 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 All calls to pc_init1() pass the same expressions as arguments, so move the expressions inside pc_init1(). Signed-off-by: Eduardo Habkost --- hw/pc_piix.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 3c4ce8f..5093ce5 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -118,9 +118,7 @@ static void ioapic_init(GSIState *gsi_state) } /* PC hardware initialisation */ -static void pc_init1(MemoryRegion *system_memory, - MemoryRegion *system_io, - ram_addr_t ram_size, +static void pc_init1(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, @@ -147,6 +145,8 @@ static void pc_init1(MemoryRegion *system_memory, MemoryRegion *ram_memory; MemoryRegion *pci_memory; MemoryRegion *rom_memory; + MemoryRegion *system_memory = get_system_memory(); + MemoryRegion *system_io = get_system_io(); void *fw_cfg = NULL; pc_cpus_init(cpu_model); @@ -295,9 +295,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args) const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; const char *boot_device = args->boot_device; - pc_init1(get_system_memory(), - get_system_io(), - ram_size, boot_device, + pc_init1(ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 1, 1); } @@ -310,9 +308,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args) const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; const char *boot_device = args->boot_device; - pc_init1(get_system_memory(), - get_system_io(), - ram_size, boot_device, + pc_init1(ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 1, 0); } @@ -327,9 +323,7 @@ static void pc_init_isa(QEMUMachineInitArgs *args) const char *boot_device = args->boot_device; if (cpu_model == NULL) cpu_model = "486"; - pc_init1(get_system_memory(), - get_system_io(), - ram_size, boot_device, + pc_init1(ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 0, 1); }