mm/memory.c: use NULL instead of literal 0
authorTobin C Harding <me@tobin.cc>
Fri, 24 Feb 2017 22:58:59 +0000 (14:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 25 Feb 2017 01:46:55 +0000 (17:46 -0800)
Patch fixes sparse warning: Using plain integer as NULL pointer.
Replaces assignment of 0 to pointer with NULL assignment.

Link: http://lkml.kernel.org/r/1485992240-10986-2-git-send-email-me@tobin.cc
Signed-off-by: Tobin C Harding <me@tobin.cc>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c

index 6040b74d02a2bbce55f22e05b1bd723e5c31bb4b..747a2cdd2f7d91c5e6f449d870977545b97ab716 100644 (file)
@@ -2920,7 +2920,7 @@ static int pte_alloc_one_map(struct vm_fault *vmf)
                atomic_long_inc(&vma->vm_mm->nr_ptes);
                pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte);
                spin_unlock(vmf->ptl);
-               vmf->prealloc_pte = 0;
+               vmf->prealloc_pte = NULL;
        } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd, vmf->address))) {
                return VM_FAULT_OOM;
        }
@@ -2968,7 +2968,7 @@ static void deposit_prealloc_pte(struct vm_fault *vmf)
         * count that as nr_ptes.
         */
        atomic_long_inc(&vma->vm_mm->nr_ptes);
-       vmf->prealloc_pte = 0;
+       vmf->prealloc_pte = NULL;
 }
 
 static int do_set_pmd(struct vm_fault *vmf, struct page *page)
@@ -3374,7 +3374,7 @@ static int do_fault(struct vm_fault *vmf)
        /* preallocated pagetable is unused: free it */
        if (vmf->prealloc_pte) {
                pte_free(vma->vm_mm, vmf->prealloc_pte);
-               vmf->prealloc_pte = 0;
+               vmf->prealloc_pte = NULL;
        }
        return ret;
 }