Arthur Heymans has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61891 )
Change subject: drivers/usb/ehci_debug.c: Fix unused variable warning ......................................................................
drivers/usb/ehci_debug.c: Fix unused variable warning
Clang complains about unused variables when DEBUG_CONSOLE_INIT is not set.
Change-Id: Icf5fd69fbf54b0d40bfdb17d1396d77dcb0a6060 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/61891 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/drivers/usb/ehci_debug.c 1 file changed, 8 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 2fbdf3a..db42ce4 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -20,16 +20,15 @@ struct dbgp_pipe ep_pipe[DBGP_MAX_ENDPOINTS]; } __packed;
-#if CONFIG(DEBUG_CONSOLE_INIT) -/* When selected, you can debug the connection of usbdebug dongle. - * EHCI port register bits and USB packets are dumped on console, - * assuming some other console already works. +/* With CONFIG(DEBUG_CONSOLE_INIT), you can debug the connection of + * usbdebug dongle. EHCI port register bits and USB packets are dumped + * on console, assuming some other console already works. */ -# define dprintk(LEVEL, args...) \ - do { if (!dbgp_enabled()) printk(LEVEL, ##args); } while (0) -#else -# define dprintk(LEVEL, args...) do {} while (0) -#endif +#define dprintk(LEVEL, args...) \ + do { \ + if (CONFIG(DEBUG_CONSOLE_INIT) && !dbgp_enabled()) \ + printk(LEVEL, ##args); \ + } while (0)
#define DBGP_LEN_UPDATE(x, len) (((x) & ~0x0f) | ((len) & 0x0f))