diff options
author | Tobin C Harding <me@tobin.cc> | 2017-02-24 17:58:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-24 20:46:55 -0500 |
commit | 7f2b6ce8e31ef843f5ece7fd302119d659b015f7 (patch) | |
tree | 55c871fcf3c4030df6e9695665e5b97ab094144f /mm | |
parent | f2bf14d14dbc50dc56be3ebd18652ea2738ef6f8 (diff) |
mm/memory.c: use NULL instead of literal 0
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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index 6040b74d02a2..747a2cdd2f7d 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2920,7 +2920,7 @@ static int pte_alloc_one_map(struct vm_fault *vmf) | |||
2920 | atomic_long_inc(&vma->vm_mm->nr_ptes); | 2920 | atomic_long_inc(&vma->vm_mm->nr_ptes); |
2921 | pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); | 2921 | pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); |
2922 | spin_unlock(vmf->ptl); | 2922 | spin_unlock(vmf->ptl); |
2923 | vmf->prealloc_pte = 0; | 2923 | vmf->prealloc_pte = NULL; |
2924 | } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd, vmf->address))) { | 2924 | } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd, vmf->address))) { |
2925 | return VM_FAULT_OOM; | 2925 | return VM_FAULT_OOM; |
2926 | } | 2926 | } |
@@ -2968,7 +2968,7 @@ static void deposit_prealloc_pte(struct vm_fault *vmf) | |||
2968 | * count that as nr_ptes. | 2968 | * count that as nr_ptes. |
2969 | */ | 2969 | */ |
2970 | atomic_long_inc(&vma->vm_mm->nr_ptes); | 2970 | atomic_long_inc(&vma->vm_mm->nr_ptes); |
2971 | vmf->prealloc_pte = 0; | 2971 | vmf->prealloc_pte = NULL; |
2972 | } | 2972 | } |
2973 | 2973 | ||
2974 | static int do_set_pmd(struct vm_fault *vmf, struct page *page) | 2974 | static int do_set_pmd(struct vm_fault *vmf, struct page *page) |
@@ -3374,7 +3374,7 @@ static int do_fault(struct vm_fault *vmf) | |||
3374 | /* preallocated pagetable is unused: free it */ | 3374 | /* preallocated pagetable is unused: free it */ |
3375 | if (vmf->prealloc_pte) { | 3375 | if (vmf->prealloc_pte) { |
3376 | pte_free(vma->vm_mm, vmf->prealloc_pte); | 3376 | pte_free(vma->vm_mm, vmf->prealloc_pte); |
3377 | vmf->prealloc_pte = 0; | 3377 | vmf->prealloc_pte = NULL; |
3378 | } | 3378 | } |
3379 | return ret; | 3379 | return ret; |
3380 | } | 3380 | } |