From: Simon Glass <simon.glass@canonical.com> The debug() macro in mkimage.h expands to nothing when MKIMAGE_DEBUG is not defined. This causes the compiler to warn about unused variables that are only referenced in debug() statements. Fix this using the same approach as the debug_cond() macro. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- tools/mkimage.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/mkimage.h b/tools/mkimage.h index 5d6bcc9301a..a356d20c3b1 100644 --- a/tools/mkimage.h +++ b/tools/mkimage.h @@ -25,9 +25,13 @@ #undef MKIMAGE_DEBUG #ifdef MKIMAGE_DEBUG -#define debug(fmt,args...) printf (fmt ,##args) +#define debug(fmt, args...) printf(fmt, ##args) #else -#define debug(fmt,args...) +#define debug(fmt, args...) \ + do { \ + if (0) \ + printf(fmt, ##args); \ + } while (0) #endif /* MKIMAGE_DEBUG */ #define log_debug(fmt, args...) debug(fmt, ##args) -- 2.43.0