[PATCH] alpha/mm: Fix comparing pointer

wuyonggang001@208suo.com posted 1 patch 2 years, 7 months ago
arch/alpha/mm/fault.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] alpha/mm: Fix comparing pointer
Posted by wuyonggang001@208suo.com 2 years, 7 months ago
Fix the following coccicheck warning:

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

Signed-off-by: Yonggang Wu <wuyonggang001@208suo.com>
---
  arch/alpha/mm/fault.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index 7b01ae4f3bc6..31db549ef0b5 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -197,7 +197,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 != NULL) {
          unsigned long newpc;
          newpc = fixup_exception(dpf_reg, fixup, regs->pc);
          regs->pc = newpc;
Re: [PATCH] alpha/mm: Fix comparing pointer
Posted by Peter Xu 2 years, 7 months ago
On Wed, Jun 14, 2023 at 02:59:20PM +0800, wuyonggang001@208suo.com wrote:
> Fix the following coccicheck warning:
> 
> arch/alpha/mm/fault.c:200:52-53: WARNING comparing pointer to 0
> 
> Signed-off-by: Yonggang Wu <wuyonggang001@208suo.com>

Acked-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu