Skip to contentSkip to conversation

mm/mmap: Remove sparse-warning (NULL as 0).

PATCH Applied Richard Knutsson 2 participants 2 messages Dec 8, 2007 – Dec 22, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/mmap: Remove sparse-warning (NULL as 0).

Fixing:
CHECK mm/mmap.c
mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1944:29: warning: Using plain integer as NULL pointer

---
Added by: 8869477a49c3e99def1fcdadd6bbc407fea14b45 (Linus' tree) Compile-tested on i386 with all[yes|mod|no]config.

mm/mmap.c +2 -2
index 15678aa..bfa389f 100644
@@ -1620,7 +1620,7 @@ static inline int expand_downwards(struct vm_area_struct *vma,
 		return -ENOMEM;
 
 	address &= PAGE_MASK;
-	error = security_file_mmap(0, 0, 0, 0, address, 1);
+	error = security_file_mmap(NULL, 0, 0, 0, address, 1);
 	if (error)
 		return error;
 
@@ -1941,7 +1941,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
 	if (is_hugepage_only_range(mm, addr, len))
 		return -EINVAL;
 
-	error = security_file_mmap(0, 0, 0, 0, addr, 1);
+	error = security_file_mmap(NULL, 0, 0, 0, addr, 1);
 	if (error)
 		return error;
 
Applied
#1 lore raw
Quoted 10 lines · Richard Knutsson

Fixing:
CHECK mm/mmap.c
mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1944:29: warning: Using plain integer as NULL pointer

---
Added by: 8869477a49c3e99def1fcdadd6bbc407fea14b45 (Linus' tree) Compile-tested on i386 with all[yes|mod|no]config.

Thanks, applied to

git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.git#for-akpm

- James

Signature · 2 lines
James Morris
<[email protected]>