From: Jan Kara <jack@suse.cz>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.com>,
Arnd Bergmann <arnd@arndb.de>,
Harshad Shirwadkar <harshadshirwadkar@gmail.com>,
Mauricio Faria de Oliveira <mfo@canonical.com>,
Andreas Dilger <adilger@dilger.ca>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
"zhangyi (F)" <yi.zhang@huawei.com>,
Alexander Lochmann <alexander.lochmann@tu-dortmund.de>,
Hui Su <sh_def@163.com>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] jbd2: avoid -Wempty-body warnings
Date: Tue, 30 Mar 2021 17:15:33 +0200 [thread overview]
Message-ID: <20210330151533.GA10067@quack2.suse.cz> (raw)
In-Reply-To: <20210322102152.95684-1-arnd@kernel.org>
On Mon 22-03-21 11:21:38, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building with 'make W=1' shows a harmless -Wempty-body warning:
>
> fs/jbd2/recovery.c: In function 'fc_do_one_pass':
> fs/jbd2/recovery.c:267:75: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 267 | jbd_debug(3, "Fast commit replay failed, err = %d\n", err);
> | ^
>
> Change the empty dprintk() macros to no_printk(), which avoids this
> warning and adds format string checking.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Sure. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> include/linux/jbd2.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index 99d3cd051ac3..232e6285536a 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -61,7 +61,7 @@ void __jbd2_debug(int level, const char *file, const char *func,
> #define jbd_debug(n, fmt, a...) \
> __jbd2_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
> #else
> -#define jbd_debug(n, fmt, a...) /**/
> +#define jbd_debug(n, fmt, a...) no_printk(fmt, ##a)
> #endif
>
> extern void *jbd2_alloc(size_t size, gfp_t flags);
> --
> 2.29.2
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-03-30 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 10:21 [PATCH] jbd2: avoid -Wempty-body warnings Arnd Bergmann
2021-03-30 15:15 ` Jan Kara [this message]
2021-04-06 2:39 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210330151533.GA10067@quack2.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=alexander.lochmann@tu-dortmund.de \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=harshadshirwadkar@gmail.com \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mfo@canonical.com \
--cc=sh_def@163.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).