From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0014287928525830603==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] fscache: fix bugon.cocci warnings Date: Tue, 16 Jun 2020 01:28:48 +0800 Message-ID: <20200615172848.GA5766@acbb553cd9e9> In-Reply-To: <202006160139.HZ5xpRtQ%lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0014287928525830603== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org TO: David Howells CC: linux-cachefs(a)redhat.com CC: linux-kernel(a)vger.kernel.org From: kernel test robot fs/fscache/read_helper.c:88:2-5: WARNING: Use BUG_ON instead of if conditio= n 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: fcea9961a44e ("fscache: Add read helper") Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.g= it fscache-iter head: a089b9d71e41906ae18dd092be5fa572fbc15df9 commit: fcea9961a44e36a0212bba52c92e63c1985ca295 [39/60] fscache: Add read = helper :::::: branch date: 3 hours ago :::::: commit date: 3 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)); } = /* --===============0014287928525830603==--