linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Zou Wei <zou_wei@huawei.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] blk-mq: Use BUG_ON() instead of BUG()
Date: Wed, 29 Apr 2020 00:26:29 -0700	[thread overview]
Message-ID: <20200429072629.GE11410@infradead.org> (raw)
In-Reply-To: <1588126224-47877-1-git-send-email-zou_wei@huawei.com>

On Wed, Apr 29, 2020 at 10:10:24AM +0800, Zou Wei wrote:
> Fixes coccicheck warning:
> 
>  block/blk-mq.c:546:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
> 
> Fixes: 63151a449eba ("blk-mq: allow drivers to hook into I/O completion")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>  block/blk-mq.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index bcc3a23..49a227e 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -542,8 +542,7 @@ EXPORT_SYMBOL(__blk_mq_end_request);
>  
>  void blk_mq_end_request(struct request *rq, blk_status_t error)
>  {
> -	if (blk_update_request(rq, error, blk_rq_bytes(rq)))
> -		BUG();
> +	BUG_ON(blk_update_request(rq, error, blk_rq_bytes(rq)));

I don't think hiding something that actually does do the work in a
BUG_ON ever is a good style.

  reply	other threads:[~2020-04-29  7:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  2:10 [PATCH -next] blk-mq: Use BUG_ON() instead of BUG() Zou Wei
2020-04-29  7:26 ` Christoph Hellwig [this message]
2020-04-29 15:15   ` Jens Axboe

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=20200429072629.GE11410@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zou_wei@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).