From b6607a1a204d52fe13746cc9c3d2da4303e39b18 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 4 Feb 2015 18:33:05 +0100 Subject: serial: Factor out common serial_hds_isa_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Anthony Liguori Cc: "Michael S. Tsirkin" Cc: Aurelien Jarno Cc: Leon Alrae Cc: Blue Swirl Signed-off-by: Markus Armbruster Signed-off-by: Andreas Färber --- hw/sparc64/sun4u.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'hw/sparc64') diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 3ff5bd8871..082b8e0eb3 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -849,11 +849,8 @@ static void sun4uv_init(MemoryRegion *address_space_mem, NULL, 115200, serial_hds[i], DEVICE_BIG_ENDIAN); i++; } - for(; 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); for(i = 0; i < MAX_PARALLEL_PORTS; i++) { if (parallel_hds[i]) { -- cgit v1.2.3 From 07dc788054d714a07df08e2eacc8c2e1c47b9a58 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 4 Feb 2015 18:33:07 +0100 Subject: parallel: Factor out common parallel_hds_isa_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maintainers of affected machines cc'ed. Cc: Anthony Liguori Cc: "Michael S. Tsirkin" Cc: Aurelien Jarno Cc: Leon Alrae Cc: Blue Swirl Signed-off-by: Markus Armbruster Signed-off-by: Andreas Färber --- hw/sparc64/sun4u.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'hw/sparc64') diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 082b8e0eb3..17cf61f720 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -851,12 +851,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, } serial_hds_isa_init(isa_bus, MAX_SERIAL_PORTS); - - for(i = 0; i < MAX_PARALLEL_PORTS; i++) { - if (parallel_hds[i]) { - parallel_init(isa_bus, i, parallel_hds[i]); - } - } + parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); for(i = 0; i < nb_nics; i++) pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL); -- cgit v1.2.3