From c80544dc0b87bb65038355e7aafdc30be16b26ab Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 18 Oct 2007 03:07:05 -0700 Subject: sparse pointer use of zero as null Get rid of sparse related warnings from places that use integer as NULL pointer. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stephen Hemminger Cc: Andi Kleen Cc: Jeff Garzik Cc: Matt Mackall Cc: Ian Kent Cc: Arnd Bergmann Cc: Davide Libenzi Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/hugetlb.c | 2 +- mm/mremap.c | 4 ++-- mm/vmscan.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mm') diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ae2959bb59c..034617f8cdb 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1020,7 +1020,7 @@ static long region_chg(struct list_head *head, long f, long t) * size such that we can guarentee to record the reservation. */ if (&rg->link == head || t < rg->from) { nrg = kmalloc(sizeof(*nrg), GFP_KERNEL); - if (nrg == 0) + if (!nrg) return -ENOMEM; nrg->from = f; nrg->to = f; diff --git a/mm/mremap.c b/mm/mremap.c index 8ea5c2412c6..08e3c7f2bd1 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -291,7 +291,7 @@ unsigned long do_mremap(unsigned long addr, if ((addr <= new_addr) && (addr+old_len) > new_addr) goto out; - ret = security_file_mmap(0, 0, 0, 0, new_addr, 1); + ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); if (ret) goto out; @@ -399,7 +399,7 @@ unsigned long do_mremap(unsigned long addr, goto out; } - ret = security_file_mmap(0, 0, 0, 0, new_addr, 1); + ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); if (ret) goto out; } diff --git a/mm/vmscan.c b/mm/vmscan.c index e1471385d00..cb474cc9964 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1282,7 +1282,7 @@ out: */ if (priority < 0) priority = 0; - for (i = 0; zones[i] != 0; i++) { + for (i = 0; zones[i] != NULL; i++) { struct zone *zone = zones[i]; if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) -- cgit v1.2.3