From be1765f39884ec0de413f8619685b3481b1dfa5a Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Tue, 17 Mar 2020 16:05:37 +0100 Subject: hw/ide: Do ide_drive_get() within pci_ide_create_devs() The pci_ide_create_devs() function takes a hd_table parameter but all callers just pass what ide_drive_get() returns so we can do it locally simplifying callers and removing hd_table parameter. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster Message-id: e9713fdded4d212fa68ed03b844e531934226a6f.1584457537.git.balaton@eik.bme.hu Signed-off-by: John Snow --- hw/isa/piix4.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'hw/isa') diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 706eb5be69..cc3e5cef8c 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -241,11 +241,8 @@ static void piix4_register_types(void) type_init(piix4_register_types) -DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, - I2CBus **smbus, size_t ide_buses) +DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus) { - size_t ide_drives = ide_buses * MAX_IDE_DEVS; - DriveInfo **hd; PCIDevice *pci; DeviceState *dev; int devfn = PCI_DEVFN(10, 0); @@ -258,10 +255,7 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, } pci = pci_create_simple(pci_bus, devfn + 1, "piix4-ide"); - hd = g_new(DriveInfo *, ide_drives); - ide_drive_get(hd, ide_drives); - pci_ide_create_devs(pci, hd); - g_free(hd); + pci_ide_create_devs(pci); pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { -- cgit v1.2.3-55-g7522