pc: Use PCMachineState for pc_memory_init() argument pc_memory_init() already expects a PCMachineState object, there's no point in upcasting it to MachineState before calling the function. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 255476b..a9a9cf4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c
@@ -1289,7 +1289,7 @@ return fw_cfg; } -FWCfgState *pc_memory_init(MachineState *machine, +FWCfgState *pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size, @@ -1301,7 +1301,7 @@ MemoryRegion *ram, *option_rom_mr; MemoryRegion *ram_below_4g, *ram_above_4g; FWCfgState *fw_cfg; - PCMachineState *pcms = PC_MACHINE(machine); + MachineState *machine = MACHINE(pcms); assert(machine->ram_size == below_4g_mem_size + above_4g_mem_size);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index b975c21..18e9aa5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c
@@ -178,7 +178,7 @@ /* allocate ram and load rom/bios */ if (!xen_enabled()) { - pc_memory_init(machine, system_memory, + pc_memory_init(pcms, system_memory, below_4g_mem_size, above_4g_mem_size, rom_memory, &ram_memory, guest_info); } else if (machine->kernel_filename != NULL) {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 441e9d9..6763f0d 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c
@@ -170,7 +170,7 @@ /* allocate ram and load rom/bios */ if (!xen_enabled()) { - pc_memory_init(machine, get_system_memory(), + pc_memory_init(pcms, get_system_memory(), below_4g_mem_size, above_4g_mem_size, rom_memory, &ram_memory, guest_info); }
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d8184cd..4fa2b3f 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h
@@ -185,7 +185,7 @@ const char *initrd_filename, ram_addr_t below_4g_mem_size, PcGuestInfo *guest_info); -FWCfgState *pc_memory_init(MachineState *machine, +FWCfgState *pc_memory_init(PCMachineState *pcms, MemoryRegion *system_memory, ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size,