Commit 44a52022 authored by Randy Dunlap's avatar Randy Dunlap Committed by Jan Kara

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/e18a7395-61fb-2093-18e8-ed4f8cf56248@infradead.orgSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Jan Kara <jack@suse.com>
Cc: linux-ext4@vger.kernel.org
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 32302085
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/printk.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mbcache.h> #include <linux/mbcache.h>
#include <linux/quotaops.h> #include <linux/quotaops.h>
...@@ -84,8 +85,8 @@ ...@@ -84,8 +85,8 @@
printk("\n"); \ printk("\n"); \
} while (0) } while (0)
#else #else
# define ea_idebug(f...) # define ea_idebug(inode, f...) no_printk(f)
# define ea_bdebug(f...) # define ea_bdebug(bh, f...) no_printk(f)
#endif #endif
static int ext2_xattr_set2(struct inode *, struct buffer_head *, static int ext2_xattr_set2(struct inode *, struct buffer_head *,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment