[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove
From: |
Bernhard Beschow |
Subject: |
[PATCH 7/9] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it |
Date: |
Thu, 8 Feb 2024 23:03:47 +0100 |
pc_system_flash_create() checked for pcmc->pci_enabled which is redundant since
its caller already checked it. The method can be turned into just two lines, so
inline and remove it.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/pc_sysfw.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index b4c3833352..2dcaa116ad 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -91,18 +91,6 @@ static PFlashCFI01 *pc_pflash_create(PCMachineState *pcms,
return PFLASH_CFI01(dev);
}
-static void pc_system_flash_create(PCMachineState *pcms)
-{
- PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
-
- if (pcmc->pci_enabled) {
- pcms->flash[0] = pc_pflash_create(pcms, "system.flash0",
- "pflash0");
- pcms->flash[1] = pc_pflash_create(pcms, "system.flash1",
- "pflash1");
- }
-}
-
static void pc_system_flash_cleanup_unused(PCMachineState *pcms)
{
char *prop_name;
@@ -212,7 +200,8 @@ void pc_system_firmware_init(PCMachineState *pcms,
return;
}
- pc_system_flash_create(pcms);
+ pcms->flash[0] = pc_pflash_create(pcms, "system.flash0", "pflash0");
+ pcms->flash[1] = pc_pflash_create(pcms, "system.flash1", "pflash1");
/* Map legacy -drive if=pflash to machine properties */
for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) {
--
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, 2024/02/08
- [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 <=
- [PATCH 8/9] hw/i386/pc: Populate RTC attribute directly, Bernhard Beschow, 2024/02/08
- [PATCH 9/9] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables, Bernhard Beschow, 2024/02/08
- [PATCH 5/9] hw/i386/pc: Defer smbios_set_defaults() to machine_done, Bernhard Beschow, 2024/02/08
- Re: [PATCH 0/9] Simplify initialization of PC machines, Bernhard Beschow, 2024/02/13
- Re: [PATCH 0/9] Simplify initialization of PC machines, Philippe Mathieu-Daudé, 2024/02/22
- Re: [PATCH 0/9] Simplify initialization of PC machines, Michael S. Tsirkin, 2024/02/22