diff options
author | Kaixu Xia <kaixuxia@tencent.com> | 2020-11-09 09:06:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-02-19 01:32:01 +0100 |
commit | 76962e03934e1a77795852c1d64bd8491a00fb52 (patch) | |
tree | 8bb88e01831d915846ed1b850d0d95d13ab7c8ed /arch/sparc/mm/srmmu.c | |
parent | sparc: fix led.c driver when PROC_FS is not enabled (diff) | |
download | linux-76962e03934e1a77795852c1d64bd8491a00fb52.tar.xz linux-76962e03934e1a77795852c1d64bd8491a00fb52.zip |
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>
Diffstat (limited to 'arch/sparc/mm/srmmu.c')
-rw-r--r-- | arch/sparc/mm/srmmu.c | 2 |
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); |