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>
This commit is contained in:
Kaixu Xia 2020-11-09 16:06:56 +08:00 committed by David S. Miller
parent b3554aa247
commit 76962e0393
1 changed files with 1 additions and 1 deletions

View File

@ -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);