linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] alpha/mm: Fix comparing pointer
       [not found] <20230614065602.29731-1-zhanglibing@cdjrlc.com>
@ 2023-06-14  6:59 ` wuyonggang001
  2023-06-14 12:37   ` Peter Xu
  0 siblings, 1 reply; 2+ messages in thread
From: wuyonggang001 @ 2023-06-14  6:59 UTC (permalink / raw)
  To: peterx, viro; +Cc: linux-alpha, linux-kernel

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] alpha/mm: Fix comparing pointer
  2023-06-14  6:59 ` [PATCH] alpha/mm: Fix comparing pointer wuyonggang001
@ 2023-06-14 12:37   ` Peter Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Xu @ 2023-06-14 12:37 UTC (permalink / raw)
  To: wuyonggang001; +Cc: viro, linux-alpha, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-14 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230614065602.29731-1-zhanglibing@cdjrlc.com>
2023-06-14  6:59 ` [PATCH] alpha/mm: Fix comparing pointer wuyonggang001
2023-06-14 12:37   ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).