Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
drivers/usb/ehci_debug.c: Drop preprocessor usage
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 th3fanbus@gmail.com --- M src/drivers/usb/ehci_debug.c 1 file changed, 14 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/43295/1
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 5af8e2e..e5841d7 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -584,23 +584,21 @@ //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 (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; } - if (--playtimes) { - ehci_debug_select_port(new_debug_port); - goto try_next_time; - } -#else - if (0) - goto try_next_port; - if (--playtimes) - goto try_next_time; -#endif
return -10; }
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
Patch Set 1: Code-Review+1
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
Patch Set 1: Code-Review+1
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
Patch Set 1: Code-Review+1
fail is caused by parent
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
Patch Set 2: Code-Review+2
Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43295 )
Change subject: drivers/usb/ehci_debug.c: Drop preprocessor usage ......................................................................
drivers/usb/ehci_debug.c: Drop preprocessor usage
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 th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/43295 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Michael Niewöhner Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/drivers/usb/ehci_debug.c 1 file changed, 14 insertions(+), 16 deletions(-)
Approvals: build bot (Jenkins): Verified Kyösti Mälkki: Looks good to me, but someone else must approve Arthur Heymans: Looks good to me, but someone else must approve Michael Niewöhner: Looks good to me, approved
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 5af8e2e..e5841d7 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -584,23 +584,21 @@ //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 (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; } - if (--playtimes) { - ehci_debug_select_port(new_debug_port); - goto try_next_time; - } -#else - if (0) - goto try_next_port; - if (--playtimes) - goto try_next_time; -#endif
return -10; }