LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH linux-next] arch/sparc/mm/fault_64.c: fix bugon.cocci warnings
@ 2021-08-23  2:07 CGEL
  0 siblings, 0 replies; only message in thread
From: CGEL @ 2021-08-23  2:07 UTC (permalink / raw)
  To: David S . Miller
  Cc: Eric W . Biederman, sparclinux, linux-kernel, Jing Yangyang, Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

Use BUG_ON instead of a if condition followed by BUG.

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

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 arch/sparc/mm/fault_64.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
index 9a9652a..672f11b 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -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)) {
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-23  2:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23  2:07 [PATCH linux-next] arch/sparc/mm/fault_64.c: fix bugon.cocci warnings CGEL

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).