um: Replace if (cond) BUG() with BUG_ON()
authorChangcheng Deng <deng.changcheng@zte.com.cn>
Sat, 28 Aug 2021 01:11:08 +0000 (18:11 -0700)
committerRichard Weinberger <richard@nod.at>
Tue, 21 Dec 2021 20:18:39 +0000 (21:18 +0100)
Fix the following coccinelle reports:

./arch/um/kernel/mem.c:89:2-5: WARNING: Use BUG_ON instead of if
condition followed by BUG.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/mem.c

index 0039771eb01cd40f9bb163bedf5f914b95bdea5b..15295c3237a005527e67bcbdfa0df2447dd3e88d 100644 (file)
@@ -85,8 +85,7 @@ static void __init one_md_table_init(pud_t *pud)
                      __func__, PAGE_SIZE, PAGE_SIZE);
 
        set_pud(pud, __pud(_KERNPG_TABLE + (unsigned long) __pa(pmd_table)));
-       if (pmd_table != pmd_offset(pud, 0))
-               BUG();
+       BUG_ON(pmd_table != pmd_offset(pud, 0));
 #endif
 }