]> git.baikalelectronics.ru Git - kernel.git/commit
ext2: fix empty body warnings when -Wextra is used
authorRandy Dunlap <rdunlap@infradead.org>
Mon, 23 Mar 2020 02:45:41 +0000 (19:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 08:36:40 +0000 (10:36 +0200)
commit30f1a330ec86385952f4102792a2cc0b9e9f0883
treebd3e5c3016cea731fa15d33bb54ea0300564a1de
parent8a4282c1d619f3d26e0ebc6aae6ea7ef101a4d40
ext2: fix empty body warnings when -Wextra is used

[ Upstream commit ba756d208fcaa42f0a120f30075aa506301b6d18 ]

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>
fs/ext2/xattr.c