]> www.infradead.org Git - qemu-nvme.git/commitdiff
hw/isa/piix3: Prefer pci_address_space() over get_system_memory()
authorBernhard Beschow <shentey@gmail.com>
Sat, 22 Oct 2022 15:04:31 +0000 (17:04 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 31 Oct 2022 10:32:07 +0000 (11:32 +0100)
get_system_memory() accesses global state while pci_address_space() uses
whatever has been passed to the device instance, so avoid the global.
Moreover, PIIX4 uses pci_address_space() here as well.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20221022150508.26830-7-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/isa/piix3.c

index 723ad0a896e2edff12277ddad8fb3f1b8d6486db..0bea4aefe7a5a48c441ea6d738377c79412ac14b 100644 (file)
@@ -301,7 +301,7 @@ static void pci_piix3_realize(PCIDevice *dev, Error **errp)
     PIIX3State *d = PIIX3_PCI_DEVICE(dev);
     ISABus *isa_bus;
 
-    isa_bus = isa_bus_new(DEVICE(d), get_system_memory(),
+    isa_bus = isa_bus_new(DEVICE(d), pci_address_space(dev),
                           pci_address_space_io(dev), errp);
     if (!isa_bus) {
         return;