From c67e5382fb3f312c95d8d01db40fb398e6da454d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 31 May 2012 16:26:10 -0700 Subject: 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] *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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- init/do_mounts_rd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'init/do_mounts_rd.c') diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 6212586df29a..6be2879cca66 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -1,3 +1,12 @@ +/* + * Many of the syscalls used in this file expect some of the arguments + * to be __user pointers not __kernel pointers. To limit the sparse + * noise, turn off sparse checking for this file. + */ +#ifdef __CHECKER__ +#undef __CHECKER__ +#warning "Sparse checking disabled for this file" +#endif #include #include @@ -181,7 +190,7 @@ int __init rd_load_image(char *from) char rotator[4] = { '|' , '/' , '-' , '\\' }; #endif - out_fd = sys_open((const char __user __force *) "/dev/ram", O_RDWR, 0); + out_fd = sys_open("/dev/ram", O_RDWR, 0); if (out_fd < 0) goto out; @@ -280,7 +289,7 @@ noclose_input: sys_close(out_fd); out: kfree(buf); - sys_unlink((const char __user __force *) "/dev/ram"); + sys_unlink("/dev/ram"); return res; } -- cgit v1.2.3