OSDN Git Service

staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Sun, 19 May 2019 09:35:57 +0000 (17:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2019 07:31:46 +0000 (09:31 +0200)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_pagevec.h

index f37d8fd..7af0ba8 100644 (file)
@@ -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;
 }