Skip to contentSkip to conversation

mm: Fix warning comparing pointer to 0

PATCH New Yang Li 1 participant 1 message Jun 21, 2022 Alpha port

lore
Share & tools
lore

Yang Li

author
#0 lore raw

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

Fix the following coccicheck warning:
./arch/alpha/mm/fault.c:197:52-53: WARNING comparing pointer to 0

---
 arch/alpha/mm/fault.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/alpha/mm/fault.c +2 -1
index ef427a6bdd1a..bb3fe2949313 100644
@@ -194,7 +194,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
 
  no_context:
 	/* Are we prepared to handle this fault as an exception?  */
-	if ((fixup = search_exception_tables(regs->pc)) != 0) {
+	fixup = search_exception_tables(regs->pc);
+	if (fixup) {
 		unsigned long newpc;
 		newpc = fixup_exception(dpf_reg, fixup, regs->pc);
 		regs->pc = newpc;
Signature · 1 line
2.20.1.7.g153144c