diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-04 18:33:05 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-02-24 00:19:06 +0100 |
commit | b6607a1a204d52fe13746cc9c3d2da4303e39b18 (patch) | |
tree | 6b3ea8bd8e36c6186b309b62577aaa5b2a7a5e8b /hw/mips | |
parent | aef0d55a4bc52b1713de88c100ba6dc451578e50 (diff) | |
download | qemu-b6607a1a204d52fe13746cc9c3d2da4303e39b18.zip qemu-b6607a1a204d52fe13746cc9c3d2da4303e39b18.tar.gz qemu-b6607a1a204d52fe13746cc9c3d2da4303e39b18.tar.bz2 |
serial: Factor out common serial_hds_isa_init()
It's the same old loop copied five times, plus another instance where
it's clipped to two iterations and unrolled.
No external users of serial_isa_init() are left, so give it internal
linkage.
Maintainers of affected machines cc'ed.
Cc: Richard Henderson <rth@twiddle.net>
Cc: Anthony Liguori <aliguori@amazon.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/mips')
-rw-r--r-- | hw/mips/mips_fulong2e.c | 7 | ||||
-rw-r--r-- | hw/mips/mips_malta.c | 3 | ||||
-rw-r--r-- | hw/mips/mips_r4k.c | 6 |
3 files changed, 3 insertions, 13 deletions
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 6a9ebfa..bebf7de 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -277,7 +277,6 @@ static void mips_fulong2e_init(MachineState *machine) PCIBus *pci_bus; ISABus *isa_bus; I2CBus *smbus; - int i; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; MIPSCPU *cpu; CPUMIPSState *env; @@ -384,11 +383,7 @@ static void mips_fulong2e_init(MachineState *machine) rtc_init(isa_bus, 2000, NULL); - for(i = 0; i < MAX_SERIAL_PORTS; i++) { - if (serial_hds[i]) { - serial_isa_init(isa_bus, i, serial_hds[i]); - } - } + serial_hds_isa_init(isa_bus, MAX_SERIAL_PORTS); if (parallel_hds[0]) { parallel_init(isa_bus, 0, parallel_hds[0]); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 5845158..e57f78c 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1172,8 +1172,7 @@ void mips_malta_init(MachineState *machine) isa_create_simple(isa_bus, "i8042"); rtc_init(isa_bus, 2000, NULL); - serial_isa_init(isa_bus, 0, serial_hds[0]); - serial_isa_init(isa_bus, 1, serial_hds[1]); + serial_hds_isa_init(isa_bus, 2); if (parallel_hds[0]) parallel_init(isa_bus, 0, parallel_hds[0]); for(i = 0; i < MAX_FD; i++) { diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index a7fe0ce..1698f2d 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -283,11 +283,7 @@ void mips_r4k_init(MachineState *machine) pit = pit_init(isa_bus, 0x40, 0, NULL); - for(i = 0; i < MAX_SERIAL_PORTS; i++) { - if (serial_hds[i]) { - serial_isa_init(isa_bus, i, serial_hds[i]); - } - } + serial_hds_isa_init(isa_bus, MAX_SERIAL_PORTS); isa_vga_init(isa_bus); |