CC: [email protected]
TO: David Howells <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

fs/fscache/read_helper.c:325:3-6: 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: 66123a178f37 ("fscache: read-helper: Provide readahead and readpage 
netfs helpers")
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 
fscache-iter
head:   ed12e932b33d4566c251cb5bde1dfd83505784e0
commit: 66123a178f3713e2da26f4f0b0291faddd49a151 [40/80] fscache: read-helper: 
Provide readahead and readpage netfs helpers
:::::: branch date: 6 hours ago
:::::: commit date: 6 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
@@ -321,8 +321,7 @@ static void fscache_rreq_terminated(stru
 {
        if (test_bit(FSCACHE_RREQ_INCOMPLETE_IO, &rreq->flags) &&
            in_softirq()) {
-               if (!queue_work(system_unbound_wq, &rreq->work))
-                       BUG();
+               BUG_ON(!queue_work(system_unbound_wq, &rreq->work));
        } else {
                fscache_rreq_assess(rreq);
        }
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to