All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] fscache: fix bugon.cocci warnings
Date: Sat, 16 May 2020 23:11:20 +0800	[thread overview]
Message-ID: <20200516151120.GA82707@08ab0ccd3552> (raw)
In-Reply-To: <202005162307.aNuapYqj%lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

CC: kbuild-all(a)lists.01.org
TO: David Howells <dhowells@redhat.com>
CC: linux-cachefs(a)redhat.com
CC: linux-kernel(a)vger.kernel.org

From: kbuild test robot <lkp@intel.com>

fs/fscache/read_helper.c:82: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: 6c92415d2d3a ("fscache: Add read helper")
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 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));
 }
 
 /*

  reply	other threads:[~2020-05-16 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` kbuild test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-15 17:28 [dhowells-fs:fscache-iter 39/60] fs/fscache/read_helper.c:88:2-5: " kernel test robot
2020-06-15 17:28 ` [PATCH] fscache: fix bugon.cocci warnings kernel test robot
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 ` [PATCH] fscache: fix bugon.cocci warnings kernel test robot
2020-07-24  1:52 [dhowells-fs:fscache-iter 37/60] fs/fscache/read_helper.c:122:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-07-24  1:52 ` [PATCH] fscache: fix bugon.cocci warnings kernel 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=20200516151120.GA82707@08ab0ccd3552 \
    --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.