All of lore.kernel.org
 help / color / mirror / Atom feed
From: wuyonggang001@208suo.com
To: peterx@redhat.com, viro@zeniv.linux.org.uk
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] alpha/mm: Fix comparing pointer
Date: Wed, 14 Jun 2023 14:59:20 +0800	[thread overview]
Message-ID: <258e87a54a1dd59b4f3d62ba9fa42242@208suo.com> (raw)
In-Reply-To: <20230614065602.29731-1-zhanglibing@cdjrlc.com>

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;

       reply	other threads:[~2023-06-14  6:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230614065602.29731-1-zhanglibing@cdjrlc.com>
2023-06-14  6:59 ` wuyonggang001 [this message]
2023-06-14 12:37   ` [PATCH] alpha/mm: Fix comparing pointer Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=258e87a54a1dd59b4f3d62ba9fa42242@208suo.com \
    --to=wuyonggang001@208suo.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.