From: Hariprasad Kelam Date: Sun, 19 May 2019 09:35:57 +0000 (+0800) Subject: staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG X-Git-Tag: v5.3-rc1~126^2~469 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=3fb58b8572ae258b838a01ef1493dc2604fbc0c6;p=linux.git 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. Signed-off-by: Hariprasad Kelam [ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ] Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h index f37d8fd14771..7af0ba8d8495 100644 --- a/drivers/staging/erofs/unzip_pagevec.h +++ b/drivers/staging/erofs/unzip_pagevec.h @@ -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; }