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/i386/pc_piix.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hw/i386') diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index c399398739..9216596ec6 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -86,7 +86,6 @@ static void pc_init1(MachineState *machine, int piix3_devfn = -1; qemu_irq smi_irq; GSIState *gsi_state; - DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BusState *idebus[MAX_IDE_BUS]; ISADevice *rtc_state; MemoryRegion *ram_memory; @@ -240,20 +239,22 @@ static void pc_init1(MachineState *machine, pc_nic_init(pcmc, isa_bus, pci_bus); - ide_drive_get(hd, ARRAY_SIZE(hd)); if (pcmc->pci_enabled) { PCIDevice *dev; dev = pci_create_simple(pci_bus, piix3_devfn + 1, xen_enabled() ? "piix3-ide-xen" : "piix3-ide"); - pci_ide_create_devs(dev, hd); + pci_ide_create_devs(dev); idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); } #ifdef CONFIG_IDE_ISA -else { + else { + DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int i; + + ide_drive_get(hd, ARRAY_SIZE(hd)); for (i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; char busname[] = "ide.0"; -- cgit v1.2.3