[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/9] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc
From: |
Bernhard Beschow |
Subject: |
[PATCH 2/9] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc and isapc machines |
Date: |
Thu, 8 Feb 2024 23:03:42 +0100 |
Both invocations are the same and either one is always executed. Avoid this
redundancy.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/pc_piix.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 5ed3d69181..adb3b5ed43 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -340,11 +340,8 @@ static void pc_init1(MachineState *machine,
pc_nic_init(pcmc, isa_bus, pci_bus);
- if (pcmc->pci_enabled) {
- pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
- }
#ifdef CONFIG_IDE_ISA
- else {
+ if (!pcmc->pci_enabled) {
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
int i;
@@ -362,10 +359,11 @@ static void pc_init1(MachineState *machine,
busname[4] = '0' + i;
idebus[i] = qdev_get_child_bus(DEVICE(dev), busname);
}
- pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
}
#endif
+ pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
+
if (piix4_pm) {
smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0);
--
2.43.0
- [PATCH 0/9] Simplify initialization of PC machines, Bernhard Beschow, 2024/02/08
- [PATCH 2/9] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc and isapc machines,
Bernhard Beschow <=
- [PATCH 1/9] hw/i386/x86: Let ioapic_init_gsi() take parent as pointer, Bernhard Beschow, 2024/02/08
- [PATCH 3/9] hw/i386/x86: Turn apic_xrupt_override into class attribute, Bernhard Beschow, 2024/02/08
- [PATCH 4/9] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn(), Bernhard Beschow, 2024/02/08
- [PATCH 6/9] hw/i386/pc: Confine system flash handling to pc_sysfw, Bernhard Beschow, 2024/02/08
- [PATCH 7/9] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it, Bernhard Beschow, 2024/02/08