Skip to contentSkip to conversation

arch/sparc/mm/fault_64.c: fix bugon.cocci warnings

PATCH New CGEL 1 participant 1 message Aug 23, 2021 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

CGEL

author
#0 lore raw

PATCH 1/1 arch/sparc/mm/fault_64.c: fix bugon.cocci warnings

From: Jing Yangyang <[email protected]>

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

---
 arch/sparc/mm/fault_64.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/sparc/mm/fault_64.c +2 -3
index 9a9652a..672f11b 100644
@@ -280,9 +280,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
 	si_code = SEGV_MAPERR;
 	address = current_thread_info()->fault_address;
 
-	if ((fault_code & FAULT_CODE_ITLB) &&
-	    (fault_code & FAULT_CODE_DTLB))
-		BUG();
+	BUG_ON((fault_code & FAULT_CODE_ITLB) &&
+		(fault_code & FAULT_CODE_DTLB));
 
 	if (test_thread_flag(TIF_32BIT)) {
 		if (!(regs->tstate & TSTATE_PRIV)) {
Signature · 1 line
1.8.3.1