Skip to contentSkip to conversation

mm: Fix warning comparing pointer to 0

PATCH New Jiapeng Chong 1 participant 1 message Nov 25, 2021 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mm: Fix warning comparing pointer to 0

Fix the following coccicheck warning:

./arch/alpha/mm/fault.c:193:52-53: WARNING comparing pointer to 0.

---
Changes in v2:
-For the follow advice:
https://lore.kernel.org/lkml/[email protected]/

 arch/alpha/mm/fault.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/alpha/mm/fault.c +3 -4
index 6c0a277..89e265e 100644
@@ -190,10 +190,9 @@
 
  no_context:
 	/* Are we prepared to handle this fault as an exception?  */
-	if ((fixup = search_exception_tables(regs->pc)) != 0) {
-		unsigned long newpc;
-		newpc = fixup_exception(dpf_reg, fixup, regs->pc);
-		regs->pc = newpc;
+	fixup = search_exception_tables(regs->pc);
+	if (fixup) {
+		regs->pc = fixup_exception(dpf_reg, fixup, regs->pc);
 		return;
 	}
 
Signature · 1 line
1.8.3.1