From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] fscache: fix bugon.cocci warnings
Date: Sat, 27 Jun 2020 23:14:10 +0800 [thread overview]
Message-ID: <20200627151410.GA26948@651fe2006c6f> (raw)
In-Reply-To: <202006272346.voedACJD%lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]
CC: kbuild-all(a)lists.01.org
TO: David Howells <dhowells@redhat.com>
From: kernel test robot <lkp@intel.com>
fs/fscache/read_helper.c:88:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)
Use BUG_ON instead of a if condition followed by BUG.
Semantic patch information:
This makes an effort to find cases where BUG() follows an if
condition on an expression and replaces the if condition and BUG()
with a BUG_ON having the conditional expression of the if statement
as argument.
Generated by: scripts/coccinelle/misc/bugon.cocci
Fixes: 2c7d3b597c2d ("fscache: Add read helper")
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-iter
head: fef70d709fde3f284e93e5baae6591f90e6e4a95
commit: 2c7d3b597c2d56663f17fb0c9921158e5304de04 [38/59] fscache: Add read helper
:::::: branch date: 20 hours ago
:::::: commit date: 23 hours ago
Please take the patch only if it's a positive warning. Thanks!
read_helper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/fscache/read_helper.c
+++ b/fs/fscache/read_helper.c
@@ -84,8 +84,7 @@ static void fscache_read_copy_to_cache(s
BUG_ON(work_pending(&req->work));
INIT_WORK(&req->work, fscache_do_read_copy_to_cache);
- if (!queue_work(fscache_op_wq, &req->work))
- BUG();
+ BUG_ON(!queue_work(fscache_op_wq, &req->work));
}
/*
next prev parent reply other threads:[~2020-06-27 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-27 15:14 [dhowells-fs:fscache-iter 38/59] fs/fscache/read_helper.c:88:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-06-27 15:14 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-24 1:52 [dhowells-fs:fscache-iter 37/60] fs/fscache/read_helper.c:122:2-5: " kernel test robot
2020-07-24 1:52 ` [PATCH] fscache: fix bugon.cocci warnings kernel test robot
2020-06-15 17:28 [dhowells-fs:fscache-iter 39/60] fs/fscache/read_helper.c:88:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-06-15 17:28 ` [PATCH] fscache: fix bugon.cocci warnings kernel test robot
2020-05-16 15:11 [dhowells-fs:fscache-iter 37/61] fs/fscache/read_helper.c:82:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kbuild test robot
2020-05-16 15:11 ` [PATCH] fscache: fix bugon.cocci warnings kbuild test robot
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=20200627151410.GA26948@651fe2006c6f \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.