Skip to contentSkip to conversation

um: replace if (cond) BUG() with BUG_ON()

PATCH New Yang Li 1 participant 1 message Mar 17, 2021 User-mode Linux (UML)

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 um: replace if (cond) BUG() with BUG_ON()

Fix the following coccinelle reports:
./arch/um/kernel/mem.c:77:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG.

---
 arch/um/kernel/mem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/um/kernel/mem.c +1 -2
index 9242dc9..22e28bf 100644
@@ -73,8 +73,7 @@ static void __init one_page_table_init(pmd_t *pmd)
 
 		set_pmd(pmd, __pmd(_KERNPG_TABLE +
 					   (unsigned long) __pa(pte)));
-		if (pte != pte_offset_kernel(pmd, 0))
-			BUG();
+		BUG_ON(pte != pte_offset_kernel(pmd, 0));
 	}
 }
 
Signature · 7 lines
1.8.3.1


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um