CC: kbuild-all(a)lists.01.org
TO: David Howells <dhowells(a)redhat.com>
CC: linux-cachefs(a)redhat.com
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp(a)intel.com>
fs/fscache/read_helper.c:122: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: e7242eaae0e9 ("fscache: Add read helper")
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
fscache-iter
head: 757ac8b16a0edd3befa15c9bdcb2ab3811be945d
commit: e7242eaae0e94cafdcbe04c110ab787715b618b5 [37/60] fscache: Add read helper
:::::: branch date: 2 days ago
:::::: commit date: 2 days 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
@@ -118,8 +118,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));
}
/*