You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
243f3803cf
commit
c67e5382fb
+12
-2
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* 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 <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/ctype.h>
|
||||
@@ -330,7 +340,7 @@ static int __init do_mount_root(char *name, char *fs, int flags, void *data)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
sys_chdir((const char __user __force *)"/root");
|
||||
sys_chdir("/root");
|
||||
s = current->fs->pwd.dentry->d_sb;
|
||||
ROOT_DEV = s->s_dev;
|
||||
printk(KERN_INFO
|
||||
@@ -556,5 +566,5 @@ void __init prepare_namespace(void)
|
||||
out:
|
||||
devtmpfs_mount("dev");
|
||||
sys_mount(".", "/", NULL, MS_MOVE, NULL);
|
||||
sys_chroot((const char __user __force *)".");
|
||||
sys_chroot(".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user