[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/20] hw/isa/piix4.c: Introduce variable to store devfn
From: |
John Snow |
Subject: |
[PULL 14/20] hw/isa/piix4.c: Introduce variable to store devfn |
Date: |
Tue, 17 Mar 2020 19:23:23 -0400 |
From: BALATON Zoltan <address@hidden>
To avoid any problem with reassigning pci variable store devfn in a
variable instead of acessing it from the PCIDevice.
Signed-off-by: BALATON Zoltan <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
hw/isa/piix4.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index 7edec5e149..2cbdcd7700 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -247,9 +247,10 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus
**isa_bus,
DriveInfo **hd;
PCIDevice *pci;
DeviceState *dev;
+ int devfn = PCI_DEVFN(10, 0);
- pci = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0),
- true, TYPE_PIIX4_PCI_DEVICE);
+ pci = pci_create_simple_multifunction(pci_bus, devfn, true,
+ TYPE_PIIX4_PCI_DEVICE);
dev = DEVICE(pci);
if (isa_bus) {
*isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0"));
@@ -257,11 +258,12 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus
**isa_bus,
hd = g_new(DriveInfo *, ide_drives);
ide_drive_get(hd, ide_drives);
- pci_piix4_ide_init(pci_bus, hd, pci->devfn + 1);
+ pci_piix4_ide_init(pci_bus, hd, devfn + 1);
g_free(hd);
- pci_create_simple(pci_bus, pci->devfn + 2, "piix4-usb-uhci");
+
+ pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci");
if (smbus) {
- *smbus = piix4_pm_init(pci_bus, pci->devfn + 3, 0x1100,
+ *smbus = piix4_pm_init(pci_bus, devfn + 3, 0x1100,
isa_get_irq(NULL, 9), NULL, 0, NULL);
}
--
2.21.1
- [PULL 04/20] cmd646: remove unused pci_cmd646_ide_init() function, (continued)
- [PULL 04/20] cmd646: remove unused pci_cmd646_ide_init() function, John Snow, 2020/03/17
- [PULL 05/20] via-ide: move registration of VMStateDescription to DeviceClass, John Snow, 2020/03/17
- [PULL 06/20] ide/via: Get rid of via_ide_init(), John Snow, 2020/03/17
- [PULL 07/20] pci: Honour wmask when resetting PCI_INTERRUPT_LINE, John Snow, 2020/03/17
- [PULL 08/20] via-ide: ensure that PCI_INTERRUPT_LINE is hard-wired to its default value, John Snow, 2020/03/17
- [PULL 09/20] via-ide: initialise IDE controller in legacy mode, John Snow, 2020/03/17
- [PULL 10/20] via-ide: allow guests to write to PCI_CLASS_PROG, John Snow, 2020/03/17
- [PULL 11/20] via-ide: always use legacy IRQ 14/15 routing, John Snow, 2020/03/17
- [PULL 12/20] hd-geo-test: Clean up use of buf[] in create_qcow2_with_mbr(), John Snow, 2020/03/17
- [PULL 13/20] hw/ide: Get rid of piix3_init functions, John Snow, 2020/03/17
- [PULL 14/20] hw/isa/piix4.c: Introduce variable to store devfn,
John Snow <=
- [PULL 15/20] hw/ide: Get rid of piix4_init function, John Snow, 2020/03/17
- [PULL 16/20] hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h, John Snow, 2020/03/17
- [PULL 17/20] hw/ide/pci.c: Coding style update to fix checkpatch errors, John Snow, 2020/03/17
- [PULL 18/20] hw/ide: Do ide_drive_get() within pci_ide_create_devs(), John Snow, 2020/03/17
- [PULL 19/20] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h, John Snow, 2020/03/17
- [PULL 20/20] hw/ide: Remove unneeded inclusion of hw/ide.h, John Snow, 2020/03/17
- Re: [PULL 00/20] Ide patches, Peter Maydell, 2020/03/19