From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH] attr: replace if (cond) BUG() with BUG_ON()
Date: Wed, 17 Mar 2021 14:34:59 +0800 [thread overview]
Message-ID: <1615962899-77049-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)
Fix the following coccicheck warnings:
./fs/attr.c:349:2-5: WARNING: Use BUG_ON instead of if condition
followed by BUG.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
fs/attr.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/attr.c b/fs/attr.c
index 87ef39d..43f369e 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -344,9 +344,7 @@ int notify_change(struct user_namespace *mnt_userns, struct dentry *dentry,
* no function will ever call notify_change with both ATTR_MODE and
* ATTR_KILL_S*ID set.
*/
- if ((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) &&
- (ia_valid & ATTR_MODE))
- BUG();
+ BUG_ON((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && (ia_valid & ATTR_MODE));
if (ia_valid & ATTR_KILL_SUID) {
if (mode & S_ISUID) {
--
1.8.3.1
reply other threads:[~2021-03-17 6:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1615962899-77049-1-git-send-email-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).