aboutsummaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-26 17:22:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:15 -0400
commit562f5e638de4ef451226552fe8dd7847bacea24e (patch)
tree69a0ac78c9eca823a297c4b8e0810a5b1d4e3ee8 /init/initramfs.c
parentf0cfec11180973e4f4b2b6909623e47eaaf7ecfe (diff)
init: mark __user address space on string literals
When calling syscall service routines in kernel, some of arguments should be user pointers but were missing __user markup on string literals. Add it. Removes some sparse warnings. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Phillip Lougher <phillip@lougher.demon.co.uk> 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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 4b9c20205092..d9c6e782ff53 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -528,7 +528,7 @@ static void __init clean_rootfs(void)
528 struct linux_dirent64 *dirp; 528 struct linux_dirent64 *dirp;
529 int num; 529 int num;
530 530
531 fd = sys_open("/", O_RDONLY, 0); 531 fd = sys_open((const char __user __force *) "/", O_RDONLY, 0);
532 WARN_ON(fd < 0); 532 WARN_ON(fd < 0);
533 if (fd < 0) 533 if (fd < 0)
534 return; 534 return;
@@ -590,7 +590,8 @@ static int __init populate_rootfs(void)
590 } 590 }
591 printk(KERN_INFO "rootfs image is not initramfs (%s)" 591 printk(KERN_INFO "rootfs image is not initramfs (%s)"
592 "; looks like an initrd\n", err); 592 "; looks like an initrd\n", err);
593 fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); 593 fd = sys_open((const char __user __force *) "/initrd.image",
594 O_WRONLY|O_CREAT, 0700);
594 if (fd >= 0) { 595 if (fd >= 0) {
595 sys_write(fd, (char *)initrd_start, 596 sys_write(fd, (char *)initrd_start,
596 initrd_end - initrd_start); 597 initrd_end - initrd_start);