From: Arnd Bergmann <arnd@kernel.org>
To: "Theodore Ts'o" <tytso@mit.edu>, Jan Kara <jack@suse.com>
Cc: 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: [PATCH] jbd2: avoid -Wempty-body warnings
Date: Mon, 22 Mar 2021 11:21:38 +0100 [thread overview]
Message-ID: <20210322102152.95684-1-arnd@kernel.org> (raw)
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>
---
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
next reply other threads:[~2021-03-22 10:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 10:21 Arnd Bergmann [this message]
2021-03-30 15:15 ` [PATCH] jbd2: avoid -Wempty-body warnings Jan Kara
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=20210322102152.95684-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=adilger@dilger.ca \
--cc=alexander.lochmann@tu-dortmund.de \
--cc=arnd@arndb.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.