From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8nx0-0007fk-C5 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8nww-0005b9-Bu for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:39:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8nww-0005av-4g for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:39:22 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BE3A73B759 for ; Tue, 15 Dec 2015 11:39:21 +0000 (UTC) References: <1449859353-1574-1-git-send-email-ehabkost@redhat.com> <1449859353-1574-6-git-send-email-ehabkost@redhat.com> From: Marcel Apfelbaum Message-ID: <566FFBE6.60806@redhat.com> Date: Tue, 15 Dec 2015 13:39:18 +0200 MIME-Version: 1.0 In-Reply-To: <1449859353-1574-6-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/14] pc: Simplify pc_memory_init() signature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Igor Mammedov , Marcel Apfelbaum , "Michael S. Tsirkin" On 12/11/2015 08:42 PM, Eduardo Habkost wrote: > We can get the PcGuestInfo struct directly from PCMachineState, > and the return value is not needed at all. > > Signed-off-by: Eduardo Habkost > --- > hw/i386/pc.c | 11 +++++------ > hw/i386/pc_piix.c | 2 +- > hw/i386/pc_q35.c | 2 +- > include/hw/i386/pc.h | 9 ++++----- > 4 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 30cdfaf..b4c638d 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -1276,12 +1276,12 @@ FWCfgState *xen_load_linux(PCMachineState *pcms, > return fw_cfg; > } > > -FWCfgState *pc_memory_init(PCMachineState *pcms, > - MemoryRegion *system_memory, > - MemoryRegion *rom_memory, > - MemoryRegion **ram_memory, > - PcGuestInfo *guest_info) > +void pc_memory_init(PCMachineState *pcms, > + MemoryRegion *system_memory, > + MemoryRegion *rom_memory, > + MemoryRegion **ram_memory) > { > + PcGuestInfo *guest_info = &pcms->acpi_guest_info; > int linux_boot, i; > MemoryRegion *ram, *option_rom_mr; > MemoryRegion *ram_below_4g, *ram_above_4g; > @@ -1403,7 +1403,6 @@ FWCfgState *pc_memory_init(PCMachineState *pcms, > rom_add_option(option_rom[i].name, option_rom[i].bootindex); > } > guest_info->fw_cfg = fw_cfg; > - return fw_cfg; > } > > qemu_irq pc_allocate_cpu_irq(void) > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index 9718d7b..f7bc1c0 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -161,7 +161,7 @@ static void pc_init1(MachineState *machine, > /* allocate ram and load rom/bios */ > if (!xen_enabled()) { > pc_memory_init(pcms, system_memory, > - rom_memory, &ram_memory, guest_info); > + rom_memory, &ram_memory); > } else if (machine->kernel_filename != NULL) { > /* For xen HVM direct kernel boot, load linux here */ > xen_load_linux(pcms, guest_info); > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c > index 43ee8bb..bb1436e 100644 > --- a/hw/i386/pc_q35.c > +++ b/hw/i386/pc_q35.c > @@ -153,7 +153,7 @@ static void pc_q35_init(MachineState *machine) > /* allocate ram and load rom/bios */ > if (!xen_enabled()) { > pc_memory_init(pcms, get_system_memory(), > - rom_memory, &ram_memory, guest_info); > + rom_memory, &ram_memory); > } > > /* irq lines */ > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > index 74c0515..3943507 100644 > --- a/include/hw/i386/pc.h > +++ b/include/hw/i386/pc.h > @@ -232,11 +232,10 @@ void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, > > FWCfgState *xen_load_linux(PCMachineState *pcms, > PcGuestInfo *guest_info); > -FWCfgState *pc_memory_init(PCMachineState *pcms, > - MemoryRegion *system_memory, > - MemoryRegion *rom_memory, > - MemoryRegion **ram_memory, > - PcGuestInfo *guest_info); > +void pc_memory_init(PCMachineState *pcms, > + MemoryRegion *system_memory, > + MemoryRegion *rom_memory, > + MemoryRegion **ram_memory); > qemu_irq pc_allocate_cpu_irq(void); > DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); > void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, > Reviewed-by: Marcel Apfelbaum