summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaixu Xia <kaixuxia@tencent.com>2020-11-09 16:06:56 +0800
committerDavid S. Miller <davem@davemloft.net>2021-02-18 16:32:01 -0800
commit76962e03934e1a77795852c1d64bd8491a00fb52 (patch)
tree8bb88e01831d915846ed1b850d0d95d13ab7c8ed
parentb3554aa2470b5db1222c31e08ec9c29ab33eabc7 (diff)
downloadlinux-76962e03934e1a77795852c1d64bd8491a00fb52.tar.bz2
sparc32: Fix comparing pointer to 0 coccicheck warning
Fixes coccicheck warning: /arch/sparc/mm/srmmu.c:354:42-43: WARNING comparing pointer to 0 Avoid pointer type value compared to 0. Reported-by: Tosk Robot <tencent_os_robot@tencent.com> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc/mm/srmmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index da4e10b4cb37..6ceea577a39e 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -351,7 +351,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
pte_t *ptep;
struct page *page;
- if ((ptep = pte_alloc_one_kernel(mm)) == 0)
+ if (!(ptep = pte_alloc_one_kernel(mm)))
return NULL;
page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
spin_lock(&mm->page_table_lock);