[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200323120204.GB28951@quack2.suse.cz>
Date: Mon, 23 Mar 2020 13:02:04 +0100
From: Jan Kara <jack@...e.cz>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: Linux FS Devel <linux-fsdevel@...r.kernel.org>,
linux-ext4@...r.kernel.org, Jan Kara <jack@...e.com>
Subject: Re: [PATCH] ext2: fix empty body warnings when -Wextra is used
On Sun 22-03-20 19:45:41, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@...radead.org>
>
> 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'.
>
> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> Cc: Jan Kara <jack@...e.com>
> Cc: linux-ext4@...r.kernel.org
Thanks! I've queued the patch to my tree.
Honza
> ---
> fs/ext2/xattr.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- linux-next-20200320.orig/fs/ext2/xattr.c
> +++ linux-next-20200320/fs/ext2/xattr.c
> @@ -56,6 +56,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>
> @@ -84,8 +85,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 *,
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists