Skip to contentSkip to conversation

ARM: kprobes: address gcc -Wempty-body warning

PATCH New Arnd Bergmann 1 participant 1 message Mar 22, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: kprobes: address gcc -Wempty-body warning

From: Arnd Bergmann <[email protected]>

Building with 'make W=1' shows a warning in some configurations when 'verbose()' is defined to be empty.

arch/arm/probes/kprobes/test-core.c: In function 'kprobes_test_case_start':
arch/arm/probes/kprobes/test-core.c:1367:26: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
1367 | current_instruction);
| ^

Change the definition of verbose() to use no_printk(), allowing format string checking and avoiding the warning.

---
 arch/arm/probes/kprobes/test-core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/probes/kprobes/test-core.h +1 -1
index 19a5b2add41e..6e42c0dd82a5 100644
@@ -98,7 +98,7 @@ struct test_arg_end {
 #if VERBOSE
 #define verbose(fmt, ...) pr_info(fmt, ##__VA_ARGS__)
 #else
-#define verbose(fmt, ...)
+#define verbose(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
 #endif
 
 #define TEST_GROUP(title)					\
Signature · 1 line
2.29.2