staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
PATCH 1/1 staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
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.
--- drivers/staging/erofs/unzip_pagevec.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/erofs/unzip_pagevec.h +1 -2
@@ -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 ; }
Signature · 1 line
2.7.4
PATCH 1/1 staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
Hi Hariprasad,
Quoted 15 lines · Hariprasad Kelam
fix below warning reported by coccicheck
drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use
BUG_ONinstead of if condition followed by BUG.Signed-off-by Hariprasad Kelam <hariprasad.kelam at gmail.com>--- drivers/staging/erofs/unzip_pagevec.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/erofs/unzip_pagevec.h +0
-0
drivers/staging/erofs/unzip_pagevec.h z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor, · line 73
Quoted 6 lines
drivers/staging/erofs/unzip_pagevec.h +1
-2@@ -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);
Thanks for your report. I suggest to use DBG_BUGON for this case, let me send another version for this case.
Thanks,
Gao Xiang
Quoted 4 lines
drivers/staging/erofs/unzip_pagevec.h +0
-0return NULL ; }
PATCH v2 1/1 staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
In reply to Hariprasad KelamFrom: Hariprasad Kelam <[email protected]>
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.
---
change log v2:
- use DBG_BUGON as what said in the commit message.
Thanks,
Gao Xiang
drivers/staging/erofs/unzip_pagevec.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/erofs/unzip_pagevec.h +1 -4
@@ -69,10 +69,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,if (tags ==Z_EROFS_PAGE_TYPE_EXCLUSIVE )return tagptr_unfold_ptr (t); } - -if (unlikely (nr >= ctor->nr)) -BUG (); - +DBG_BUGON (nr >= ctor->nr);return NULL ; }
Signature · 1 line
2.17.1
Quoted 10 lines · Gao Xiang
From: Hariprasad Kelam <hariprasad.kelam at gmail.com>
fix below warning reported by coccicheck
drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use
BUG_ONinstead of if condition followed by BUG.Signed-off-by Hariprasad Kelam <hariprasad.kelam at gmail.com>[ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ]Signed-off-by Gao Xiang <gaoxiang25 at huawei.com>
Thanks,