From: kbuild test robot <lkp(a)intel.com>
arch/sparc/mm/srmmu.c:364:42-43: WARNING comparing pointer to 0
arch/sparc/mm/srmmu.c:364:42-43: WARNING comparing pointer to 0
Compare pointer-typed values to NULL rather than 0
Semantic patch information:
This makes an effort to choose between !x and x == NULL. !x is used
if it has previously been used with the function used to initialize x.
This relies on type information. More type information can be obtained
using the option -all_includes and the option -I to specify an
include path.
Generated by: scripts/coccinelle/null/badzero.cocci
Fixes: c95be5b549d6 ("sparc32: mm: Change pgtable_t type to pte_t * instead of struct
page *")
CC: Will Deacon <will(a)kernel.org>
Signed-off-by: kbuild test robot <lkp(a)intel.com>
---
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/kcsan
head: ffed638b6a2180da8fd002a46632d746af72b299
commit: c95be5b549d6af16e1f9b9307f745ef78a01d11c [4/21] sparc32: mm: Change pgtable_t type
to pte_t * instead of struct page *
srmmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -361,7 +361,7 @@ pgtable_t pte_alloc_one(struct mm_struct
pte_t *ptep;
struct page *page;
- if ((ptep = pte_alloc_one_kernel(mm)) == 0)
+ if ((ptep = pte_alloc_one_kernel(mm)) == NULL)
return NULL;
page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
if (!pgtable_pte_page_ctor(page)) {