Commit c0f100c2 authored by David S. Miller's avatar David S. Miller

[KERNEL]: Some sparse fixes for init/main.c

1) Explicitly cast to __user in syscall invocations
   where we know we are in KERNEL_DS
2) Explicitly test against zero in assignment expression
   conditional.
parent e2834fd5
......@@ -186,7 +186,7 @@ void __devinit calibrate_delay(void)
loops_per_jiffy = (1<<12);
printk("Calibrating delay loop... ");
while (loops_per_jiffy <<= 1) {
while ((loops_per_jiffy <<= 1) != 0) {
/* wait for "start of" clock tick */
ticks = jiffies;
while (ticks == jiffies)
......@@ -632,7 +632,7 @@ static int init(void * unused)
* check if there is an early userspace init. If yes, let it do all
* the work
*/
if (sys_access("/init", 0) == 0)
if (sys_access((const char __user *) "/init", 0) == 0)
execute_command = "/init";
else
prepare_namespace();
......@@ -646,7 +646,7 @@ static int init(void * unused)
unlock_kernel();
system_state = SYSTEM_RUNNING;
if (sys_open("/dev/console", O_RDWR, 0) < 0)
if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
printk("Warning: unable to open an initial console.\n");
(void) sys_dup(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment