From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5210848476001525041==" MIME-Version: 1.0 From: kbuild test robot Subject: [PATCH] fscache: fix bugon.cocci warnings Date: Sat, 16 May 2020 23:11:20 +0800 Message-ID: <20200516151120.GA82707@08ab0ccd3552> In-Reply-To: <202005162307.aNuapYqj%lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============5210848476001525041== 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: kbuild test robot fs/fscache/read_helper.c:82: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: 6c92415d2d3a ("fscache: Add read helper") Signed-off-by: kbuild test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.g= it fscache-iter head: 59f33c90ef6c1a75d4af75e5f60d98c0d965b6a2 commit: 6c92415d2d3a9828ec57bd41203f248822ab0b22 [37/61] fscache: Add read = helper :::::: branch date: 3 days ago :::::: commit date: 3 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 @@ -78,8 +78,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)); } = /* --===============5210848476001525041==--