[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210322113829.3239999-1-arnd@kernel.org>
Date: Mon, 22 Mar 2021 12:38:24 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Arnd Bergmann <arnd@...db.de>,
Christian Brauner <christian.brauner@...ntu.com>,
James Morris <jamorris@...ux.microsoft.com>,
Serge Hallyn <serge@...lyn.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] posix-acl: avoid -Wempty-body warning
From: Arnd Bergmann <arnd@...db.de>
The fallthrough comment for an ignored cmpxchg() return value
produces a harmless warning with 'make W=1':
fs/posix_acl.c: In function 'get_acl':
fs/posix_acl.c:127:36: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
127 | /* fall through */ ;
| ^
Rewrite it as gcc suggests as a step towards a clean W=1 build.
On most architectures, we could just drop the if() entirely, but
in some cases this causes a different warning.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
fs/posix_acl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index f3309a7edb49..ee6b040c8b43 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -123,8 +123,9 @@ struct posix_acl *get_acl(struct inode *inode, int type)
* to just call ->get_acl to fetch the ACL ourself. (This is going to
* be an unlikely race.)
*/
- if (cmpxchg(p, ACL_NOT_CACHED, sentinel) != ACL_NOT_CACHED)
- /* fall through */ ;
+ if (cmpxchg(p, ACL_NOT_CACHED, sentinel) != ACL_NOT_CACHED) {
+ /* fall through */
+ }
/*
* Normally, the ACL returned by ->get_acl will be cached.
--
2.29.2
Powered by blists - more mailing lists