Skip to content

Commit 44a5202

Browse files
rddunlapjankara
authored andcommitted
ext2: fix empty body warnings when -Wextra is used
When EXT2_ATTR_DEBUG is not defined, modify the 2 debug macros to use the no_printk() macro instead of <nothing>. This fixes gcc warnings when -Wextra is used: ../fs/ext2/xattr.c:252:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:258:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:330:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] ../fs/ext2/xattr.c:872:45: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] I have verified that the only object code change (with gcc 7.5.0) is the reversal of some instructions from 'cmp a,b' to 'cmp b,a'. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Randy Dunlap <[email protected]> Cc: Jan Kara <[email protected]> Cc: [email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent 3230208 commit 44a5202

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/ext2/xattr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
#include <linux/buffer_head.h>
5858
#include <linux/init.h>
59+
#include <linux/printk.h>
5960
#include <linux/slab.h>
6061
#include <linux/mbcache.h>
6162
#include <linux/quotaops.h>
@@ -84,8 +85,8 @@
8485
printk("\n"); \
8586
} while (0)
8687
#else
87-
# define ea_idebug(f...)
88-
# define ea_bdebug(f...)
88+
# define ea_idebug(inode, f...) no_printk(f)
89+
# define ea_bdebug(bh, f...) no_printk(f)
8990
#endif
9091

9192
static int ext2_xattr_set2(struct inode *, struct buffer_head *,

0 commit comments

Comments
 (0)