Skip to content

Commit

Permalink
sparc32: Fix comparing pointer to 0 coccicheck warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kaixu Xia authored and David S. Miller committed Feb 19, 2021
1 parent b3554aa commit 76962e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc/mm/srmmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 76962e0

Please sign in to comment.