All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: use BUG_ON()
@ 2015-01-29 17:46 Sudip Mukherjee
  2015-01-29 21:14 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-01-29 17:46 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Sudip Mukherjee, linux-kernel

use BUG_ON() instead of using if(condition) BUG()

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 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 8107962..d8f0922 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -337,8 +337,7 @@ EXPORT_SYMBOL(__blk_mq_end_request);
 
 void blk_mq_end_request(struct request *rq, int error)
 {
-	if (blk_update_request(rq, error, blk_rq_bytes(rq)))
-		BUG();
+	BUG_ON(blk_update_request(rq, error, blk_rq_bytes(rq)));
 	__blk_mq_end_request(rq, error);
 }
 EXPORT_SYMBOL(blk_mq_end_request);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blk-mq: use BUG_ON()
  2015-01-29 17:46 [PATCH] blk-mq: use BUG_ON() Sudip Mukherjee
@ 2015-01-29 21:14 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-01-29 21:14 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel

On 01/29/2015 09:46 AM, Sudip Mukherjee wrote:
> use BUG_ON() instead of using if(condition) BUG()
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>   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 8107962..d8f0922 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -337,8 +337,7 @@ EXPORT_SYMBOL(__blk_mq_end_request);
>
>   void blk_mq_end_request(struct request *rq, int error)
>   {
> -	if (blk_update_request(rq, error, blk_rq_bytes(rq)))
> -		BUG();
> +	BUG_ON(blk_update_request(rq, error, blk_rq_bytes(rq)));
>   	__blk_mq_end_request(rq, error);

This makes it less readable than it was before, so no.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-29 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 17:46 [PATCH] blk-mq: use BUG_ON() Sudip Mukherjee
2015-01-29 21:14 ` Jens Axboe

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.