* [PATCH] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
@ 2019-05-18 17:33 Hariprasad Kelam
[not found] ` <20190519093557.20982-1-hsiangkao@aol.com>
0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Kelam @ 2019-05-18 17:33 UTC (permalink / raw)
To: Gao Xiang, Chao Yu, Greg Kroah-Hartman, linux-erofs, devel, linux-kernel
fix below warning reported by coccicheck
drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
instead of if condition followed by BUG.
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
drivers/staging/erofs/unzip_pagevec.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h
index f37d8fd..0f61c54 100644
--- a/drivers/staging/erofs/unzip_pagevec.h
+++ b/drivers/staging/erofs/unzip_pagevec.h
@@ -70,8 +70,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,
return tagptr_unfold_ptr(t);
}
- if (unlikely(nr >= ctor->nr))
- BUG();
+ BUG_ON(nr >= ctor->nr);
return NULL;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
[not found] ` <20190519093557.20982-1-hsiangkao@aol.com>
@ 2019-05-20 2:19 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2019-05-20 2:19 UTC (permalink / raw)
To: Gao Xiang, Greg Kroah-Hartman
Cc: linux-erofs, devel, LKML, Hariprasad Kelam, Gao Xiang
On 2019/5/19 17:35, Gao Xiang wrote:
> From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
>
> fix below warning reported by coccicheck
>
> drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
> instead of if condition followed by BUG.
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> [ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ]
> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-20 2:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18 17:33 [PATCH] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG Hariprasad Kelam
[not found] ` <20190519093557.20982-1-hsiangkao@aol.com>
2019-05-20 2:19 ` [PATCH v2] " Chao Yu
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).