mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
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 <balaton@eik.bme.hu> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: e9713fdded4d212fa68ed03b844e531934226a6f.1584457537.git.balaton@eik.bme.hu Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
417adc2d50
commit
be1765f398
9 changed files with 18 additions and 35 deletions
|
@ -477,13 +477,15 @@ const VMStateDescription vmstate_ide_pci = {
|
|||
};
|
||||
|
||||
/* hd_table must contain 4 block drivers */
|
||||
void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table)
|
||||
void pci_ide_create_devs(PCIDevice *dev)
|
||||
{
|
||||
PCIIDEState *d = PCI_IDE(dev);
|
||||
DriveInfo *hd_table[2 * MAX_IDE_DEVS];
|
||||
static const int bus[4] = { 0, 0, 1, 1 };
|
||||
static const int unit[4] = { 0, 1, 0, 1 };
|
||||
int i;
|
||||
|
||||
ide_drive_get(hd_table, ARRAY_SIZE(hd_table));
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (hd_table[i]) {
|
||||
ide_create_drive(d->bus + bus[i], unit[i], hd_table[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue