[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 15/16] hw/i386/pc_piix: Turn some local variables into initial
From: |
Bernhard Beschow |
Subject: |
[PATCH v2 15/16] hw/i386/pc_piix: Turn some local variables into initializers |
Date: |
Wed, 28 Jun 2023 21:52:03 +0200 |
Eliminates an else branch.
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/pc_piix.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1df309b8e2..d07218a8c9 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;
- Object *i440fx_host;
+ uint64_t hole64_size = 0;
+ Object *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(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);
--
2.41.0
- [PATCH v2 09/16] hw/pci-host/i440fx: Move i440fx_realize() into PCII440FXState section, (continued)
- [PATCH v2 09/16] hw/pci-host/i440fx: Move i440fx_realize() into PCII440FXState section, Bernhard Beschow, 2023/06/28
- [PATCH v2 06/16] hw/pci-host/q35: Make some property name macros reusable by i440fx, Bernhard Beschow, 2023/06/28
- [PATCH v2 10/16] hw/pci-host/i440fx: Make MemoryRegion pointers accessible as properties, Bernhard Beschow, 2023/06/28
- [PATCH v2 11/16] hw/pci-host/i440fx: Add PCI_HOST_PROP_IO_MEM property, Bernhard Beschow, 2023/06/28
- [PATCH v2 05/16] hw/pci-host/q35: Initialize PCI_HOST_BYPASS_IOMMU property from board code, Bernhard Beschow, 2023/06/28
- [PATCH v2 12/16] hw/pci-host/i440fx: Add PCI_HOST_{ABOVE, BELOW}_4G_MEM_SIZE properties, Bernhard Beschow, 2023/06/28
- [PATCH v2 13/16] hw/pci-host/i440fx: Add I440FX_HOST_PROP_PCI_TYPE property, Bernhard Beschow, 2023/06/28
- [PATCH v2 14/16] hw/pci-host/i440fx: Resolve i440fx_init(), Bernhard Beschow, 2023/06/28
- [PATCH v2 15/16] hw/i386/pc_piix: Turn some local variables into initializers,
Bernhard Beschow <=
- [PATCH v2 16/16] hw/i386/pc_piix: Move i440fx' realize near its qdev_new(), Bernhard Beschow, 2023/06/28