X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=init%2Finitramfs.c;h=84c6bf111300878a095a9fb3f8f91678dbe10b65;hb=ded884c2d7f627f4f5456bbeb9d174decc3e7261;hp=8216c303b0821b15f1a353a2fea7af84abb8f4bf;hpb=cdbe8b5426e71d09882212073c27c9dcf25a71b6;p=~andy%2Flinux diff --git a/init/initramfs.c b/init/initramfs.c index 8216c303b08..84c6bf11130 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -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 #include #include @@ -74,7 +84,7 @@ static void __init free_hash(void) } } -static long __init do_utime(char __user *filename, time_t mtime) +static long __init do_utime(char *filename, time_t mtime) { struct timespec t[2]; @@ -529,7 +539,7 @@ static void __init clean_rootfs(void) struct linux_dirent64 *dirp; int num; - fd = sys_open((const char __user __force *) "/", O_RDONLY, 0); + fd = sys_open("/", O_RDONLY, 0); WARN_ON(fd < 0); if (fd < 0) return; @@ -589,7 +599,7 @@ static int __init populate_rootfs(void) } printk(KERN_INFO "rootfs image is not initramfs (%s)" "; looks like an initrd\n", err); - fd = sys_open((const char __user __force *) "/initrd.image", + fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); if (fd >= 0) { sys_write(fd, (char *)initrd_start,