* [PATCH v2] mm: Fix warning comparing pointer to 0
@ 2021-11-25 10:14 Jiapeng Chong
0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2021-11-25 10:14 UTC (permalink / raw)
To: rth; +Cc: ink, mattst88, linux-alpha, linux-kernel, Jiapeng Chong
Fix the following coccicheck warning:
./arch/alpha/mm/fault.c:193:52-53: WARNING comparing pointer to 0.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
-For the follow advice:
https://lore.kernel.org/lkml/5391025983087ae9d1292387bc0b2b37c9c57863.camel@perches.com/
arch/alpha/mm/fault.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index 6c0a277..89e265e 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-25 10:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 10:14 [PATCH v2] mm: Fix warning comparing pointer to 0 Jiapeng Chong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.