[PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument

Philippe Mathieu-Daudé posted 4 patches 8 months, 4 weeks ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
[PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
Posted by Philippe Mathieu-Daudé 8 months, 4 weeks ago
The "isapc" machine only provides an ISA bus, not a PCI one,
and doesn't instanciate any i440FX south bridge.
Its machine class defines PCMachineClass::pci_enabled = false,
and pc_init1() only uses the pci_type argument when pci_enabled
is true. Since for this machine the argument is not used,
passing NULL makes more sense.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc_piix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 400b1c1e15..fa5f93f99f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -449,7 +449,7 @@ static void pc_compat_2_0_fn(MachineState *machine)
 #ifdef CONFIG_ISAPC
 static void pc_init_isa(MachineState *machine)
 {
-    pc_init1(machine, TYPE_I440FX_PCI_DEVICE);
+    pc_init1(machine, NULL);
 }
 #endif
 
-- 
2.41.0


Re: [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
Posted by Bernhard Beschow 8 months, 4 weeks ago

Am 1. März 2024 18:59:36 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>The "isapc" machine only provides an ISA bus, not a PCI one,
>and doesn't instanciate any i440FX south bridge.
>Its machine class defines PCMachineClass::pci_enabled = false,
>and pc_init1() only uses the pci_type argument when pci_enabled
>is true. Since for this machine the argument is not used,
>passing NULL makes more sense.
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Bernhard Beschow <shentey@gmail.com>