aboutsummaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-05-31 19:26:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-31 20:49:27 -0400
commitc67e5382fb3f312c95d8d01db40fb398e6da454d (patch)
tree6e1830da7102e4f873d05b067aa39ba4425eefbc /init/initramfs.c
parent243f3803cf2a3665092c5fd6f924f453694681a6 (diff)
init: disable sparse checking of the mount.o source files
The init/mount.o source files produce a number of sparse warnings of the type: warning: incorrect type in argument 1 (different address spaces) expected char [noderef] <asn:1>*dev_name got char *name This is due to the syscalls expecting some of the arguments to be user pointers but they are being passed as kernel pointers. This is harmless but adds a lot of noise to a sparse build. To limit the noise just disable the sparse checking in the relevant source files, but still display a warning so that the user knows this has been done. Since the sparse checking has been disabled we can also remove the __user __force casts that are scattered thru the source. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 8216c303b082..84c6bf111300 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -1,3 +1,13 @@
1/*
2 * Many of the syscalls used in this file expect some of the arguments
3 * to be __user pointers not __kernel pointers. To limit the sparse
4 * noise, turn off sparse checking for this file.
5 */
6#ifdef __CHECKER__
7#undef __CHECKER__
8#warning "Sparse checking disabled for this file"
9#endif
10
1#include <linux/init.h> 11#include <linux/init.h>
2#include <linux/fs.h> 12#include <linux/fs.h>
3#include <linux/slab.h> 13#include <linux/slab.h>
@@ -74,7 +84,7 @@ static void __init free_hash(void)
74 } 84 }
75} 85}
76 86
77static long __init do_utime(char __user *filename, time_t mtime) 87static long __init do_utime(char *filename, time_t mtime)
78{ 88{
79 struct timespec t[2]; 89 struct timespec t[2];
80 90
@@ -529,7 +539,7 @@ static void __init clean_rootfs(void)
529 struct linux_dirent64 *dirp; 539 struct linux_dirent64 *dirp;
530 int num; 540 int num;
531 541
532 fd = sys_open((const char __user __force *) "/", O_RDONLY, 0); 542 fd = sys_open("/", O_RDONLY, 0);
533 WARN_ON(fd < 0); 543 WARN_ON(fd < 0);
534 if (fd < 0) 544 if (fd < 0)
535 return; 545 return;
@@ -589,7 +599,7 @@ static int __init populate_rootfs(void)
589 } 599 }
590 printk(KERN_INFO "rootfs image is not initramfs (%s)" 600 printk(KERN_INFO "rootfs image is not initramfs (%s)"
591 "; looks like an initrd\n", err); 601 "; looks like an initrd\n", err);
592 fd = sys_open((const char __user __force *) "/initrd.image", 602 fd = sys_open("/initrd.image",
593 O_WRONLY|O_CREAT, 0700); 603 O_WRONLY|O_CREAT, 0700);
594 if (fd >= 0) { 604 if (fd >= 0) {
595 sys_write(fd, (char *)initrd_start, 605 sys_write(fd, (char *)initrd_start,