From a0a94d8c647af574374b718542bb932a76431376 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 8 Jul 2020 14:08:41 +0200 Subject: drivers/usb/ehci_debug.c: Drop preprocessor usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need to use ugly preprocessor here when regular C conditional statements will work just fine. Change-Id: I5abd445a335b43fb95e4df087d44e82c3f44349b Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/43295 Tested-by: build bot (Jenkins) Reviewed-by: Michael Niewöhner Reviewed-by: Arthur Heymans Reviewed-by: Kyösti Mälkki --- src/drivers/usb/ehci_debug.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/drivers/usb') diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 5af8e2edbb..e5841d7da0 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -584,23 +584,21 @@ err: //return ret; next_debug_port: -#if CONFIG_USBDEBUG_DEFAULT_PORT == 0 - port_map_tried |= (1 << (debug_port - 1)); - new_debug_port = ((debug_port-1 + 1) % n_ports) + 1; - if (port_map_tried != ((1 << n_ports) - 1)) { - ehci_debug_select_port(new_debug_port); - goto try_next_port; - } - if (--playtimes) { - ehci_debug_select_port(new_debug_port); - goto try_next_time; + if (CONFIG_USBDEBUG_DEFAULT_PORT == 0) { + port_map_tried |= (1 << (debug_port - 1)); + new_debug_port = ((debug_port-1 + 1) % n_ports) + 1; + if (port_map_tried != ((1 << n_ports) - 1)) { + ehci_debug_select_port(new_debug_port); + goto try_next_port; + } + if (--playtimes) { + ehci_debug_select_port(new_debug_port); + goto try_next_time; + } + } else { + if (--playtimes) + goto try_next_time; } -#else - if (0) - goto try_next_port; - if (--playtimes) - goto try_next_time; -#endif return -10; } -- cgit v1.2.3