summaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2020-03-22 19:45:41 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-24 07:57:25 +0200
commit96b52bba31e44309957193ca9437e2410c410b76 (patch)
tree9d253367771e9f5e4305fc3155f34022f920e851 /fs/ext2
parent3b624885da854275c0551bd8fee59715be7f5335 (diff)
downloadlinux-stable-96b52bba31e44309957193ca9437e2410c410b76.tar.gz
linux-stable-96b52bba31e44309957193ca9437e2410c410b76.tar.bz2
linux-stable-96b52bba31e44309957193ca9437e2410c410b76.zip
ext2: fix empty body warnings when -Wextra is used
[ Upstream commit 44a52022e7f15cbaab957df1c14f7a4f527ef7cf ] 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.org Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jan Kara <jack@suse.com> Cc: linux-ext4@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/xattr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 22d817dc821e..6f6f4f89a2f0 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -55,6 +55,7 @@
#include <linux/buffer_head.h>
#include <linux/init.h>
+#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/mbcache.h>
#include <linux/quotaops.h>
@@ -85,8 +86,8 @@
printk("\n"); \
} while (0)
#else
-# define ea_idebug(f...)
-# define ea_bdebug(f...)
+# define ea_idebug(inode, f...) no_printk(f)
+# define ea_bdebug(bh, f...) no_printk(f)
#endif
static int ext2_xattr_set2(struct inode *, struct buffer_head *,