Thread (3 messages) flat view 3 messages, 3 authors, 2021-04-06
STALE1984d LANDED

Landed in mainline as d556435156b7 on 2021-04-06.

[PATCH] jbd2: avoid -Wempty-body warnings

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-03-22 10:22:54
Also in: lkml
Subsystem: journalling layer for block devices (jbd2), the rest · Maintainers: "Theodore Ts'o", Jan Kara, Linus Torvalds

From: Arnd Bergmann <arnd@arndb.de>

Building with 'make W=1' shows a harmless -Wempty-body warning:

fs/jbd2/recovery.c: In function 'fc_do_one_pass':
fs/jbd2/recovery.c:267:75: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  267 |                 jbd_debug(3, "Fast commit replay failed, err = %d\n", err);
      |                                                                           ^

Change the empty dprintk() macros to no_printk(), which avoids this
warning and adds format string checking.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/jbd2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 99d3cd051ac3..232e6285536a 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -61,7 +61,7 @@ void __jbd2_debug(int level, const char *file, const char *func,
 #define jbd_debug(n, fmt, a...) \
 	__jbd2_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
 #else
-#define jbd_debug(n, fmt, a...)    /**/
+#define jbd_debug(n, fmt, a...)  no_printk(fmt, ##a)
 #endif
 
 extern void *jbd2_alloc(size_t size, gfp_t flags);
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help