diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2022-02-12 17:25:57 +0100 |
---|---|---|
committer | Arthur Heymans <arthur@aheymans.xyz> | 2022-05-11 05:52:39 +0000 |
commit | ca9d4feca6b68dce6bf473a672a317cc25dba3fc (patch) | |
tree | f6c2496bb7f70d91a82348cd07be19c096816620 /src/drivers | |
parent | 73a7353550167eb573175e941107bbb4339b6f8e (diff) |
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>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/usb/ehci_debug.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 2fbdf3aff9..db42ce45ae 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -20,16 +20,15 @@ struct ehci_debug_info { 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)) |