Skip to contentSkip to conversation

init/do_mounts_initrd.c: fix sparse warning

PATCH In review Alexey Dobriyan 1 participant 2 messages Mar 9, 2005 – Mar 10, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 init/do_mounts_initrd.c: fix sparse warning

init/do_mounts_initrd.c +2 -2
Index: linux-2.6.11-bk1-sparse/init/do_mounts_initrd.c
===================================================================
@@ -41,7 +41,7 @@ static int __init do_linuxrc(void * shel
 static void __init handle_initrd(void)
 {
 	int error;
-	int i, pid;
+	int pid;
 
 	real_root_dev = new_encode_dev(ROOT_DEV);
 	create_dev("/dev/root.old", Root_RAM0, NULL);
@@ -58,7 +58,7 @@ static void __init handle_initrd(void)
 
 	pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
 	if (pid > 0) {
-		while (pid != sys_wait4(-1, &i, 0, NULL))
+		while (pid != sys_wait4(-1, NULL, 0, NULL))
 			yield();
 	}
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

[walter, I got "Sender address rejected: Access denied", replying to the list]

Quoted 1 line · walter harms

pid should be pid_t

Well, yes.

Quoted 1 line

because different architectures have different sizes for it.

No. pid_t => __kernel_pid_t => int => 32 bit an all archs. Look at include/asm-*/types.h and see what s32 is always typedef'ed to.

Alexey

Quoted 8 lines

init/do_mounts_initrd.c static int __init do_linuxrc(void * shel

Quoted 8 lines
init/do_mounts_initrd.c +2 -2
 
-	int i, pid;
+	int pid;
 
-		while (pid != sys_wait4(-1, &i, 0, NULL))
+		while (pid != sys_wait4(-1, NULL, 0, NULL))

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors