diff options
author | Bernhard Beschow <shentey@gmail.com> | 2023-06-30 09:37:10 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-07-10 16:29:17 -0400 |
commit | b90d7bff18c48500df86a35db56fecfb59d85088 (patch) | |
tree | 4834e6bed67005fe3119a79c23a6eef3f3bee28d /hw/i386 | |
parent | 3d664a9a386dd5968962b038d056caf182ef29a1 (diff) | |
download | qemu-b90d7bff18c48500df86a35db56fecfb59d85088.zip qemu-b90d7bff18c48500df86a35db56fecfb59d85088.tar.gz qemu-b90d7bff18c48500df86a35db56fecfb59d85088.tar.bz2 |
hw/i386/pc_piix: Turn some local variables into initializers
Eliminates an else branch.
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230630073720.21297-8-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/pc_piix.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index f9947fb..6a5b6da 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -122,11 +122,11 @@ static void pc_init1(MachineState *machine, BusState *idebus[MAX_IDE_BUS]; ISADevice *rtc_state; MemoryRegion *ram_memory; - MemoryRegion *pci_memory; - MemoryRegion *rom_memory; + MemoryRegion *pci_memory = NULL; + MemoryRegion *rom_memory = system_memory; ram_addr_t lowmem; - uint64_t hole64_size; - DeviceState *i440fx_host; + uint64_t hole64_size = 0; + DeviceState *i440fx_host = NULL; /* * Calculate ram split, for memory below and above 4G. It's a bit @@ -205,11 +205,6 @@ static void pc_init1(MachineState *machine, hole64_size = object_property_get_uint(OBJECT(i440fx_host), PCI_HOST_PROP_PCI_HOLE64_SIZE, &error_abort); - } else { - pci_memory = NULL; - rom_memory = system_memory; - i440fx_host = NULL; - hole64_size = 0; } pc_guest_info_init(pcms); |