define setup_arch() in header file
PATCH 1/1 define setup_arch() in header file
When running sparse over an ARM build of 2.6.16-rc5, I came across this error, which is due to setup_arch() being used be init/main.c, but not being defined in any headers.
This patch adds setup_arch() definition to include/linux/init.h
The warning is:
arch/arm/kernel/setup.c:730:13: warning: symbol 'setup_arch' was not declared. Should it be static?
include/linux/init.h +4 -0
@@ -69,6 +69,10 @@ extern initcall_t __security_initcall_st/* Defined in init/main.c */ extern char saved_command_line[]; + +/* used by init/main.c */ +extern void setup_arch (char **); +#endif #ifndef MODULE
Quoted 16 lines · Ben Dooks
When running sparse over an ARM build of 2.6.16-rc5, I came
across this error, which is due tosetup_arch()being used beinit/main.c, but not being defined in any headers.This patch adds
setup_arch()definition toinclude/linux/init.hThe warning is:
arch/arm/kernel/setup.c:730:13: warning: symbol 'setup_arch' was not declared. Should it be static?...
---
linux-2.6.16-rc5/include/linux/init.h2006-02-28 09:05:02.000000000 +0000
+++linux-2.6.16-rc5-fixes/include/linux/init.h2006-03-05 20:39:21.000000000 +0000
@@ -69,6 +69,10 @@ externinitcall_t__security_initcall_st
Quoted 5 lines
/* Defined in
init/main.c*/
extern char saved_command_line[];
+
+/* used byinit/main.c*/
+extern voidsetup_arch(char **);
There are already declarations of setup_arch in include/asm-ppc and include/asm-powerpc. Different declarations.
Plus there's an unneeded-with-this-patch declaration in init/main.c.
PATCH 1/1 add a proper prototype for setup_arch()
Quoted 17 lines · Andrew Morton
Quoted 16 lines · Ben Dooks
When running sparse over an ARM build of 2.6.16-rc5, I came
across this error, which is due tosetup_arch()being used beinit/main.c, but not being defined in any headers.This patch adds
setup_arch()definition toinclude/linux/init.hThe warning is:
arch/arm/kernel/setup.c:730:13: warning: symbol 'setup_arch' was not declared. Should it be static?...
---
linux-2.6.16-rc5/include/linux/init.h2006-02-28 09:05:02.000000000 +0000
+++linux-2.6.16-rc5-fixes/include/linux/init.h2006-03-05 20:39:21.000000000 +0000
@@ -69,6 +69,10 @@ externinitcall_t__security_initcall_st
Quoted 8 lines
Quoted 5 lines
/* Defined in
init/main.c*/
extern char saved_command_line[];
+
+/* used byinit/main.c*/
+extern voidsetup_arch(char **);There are already declarations of
setup_archininclude/asm-ppcandinclude/asm-powerpc. Different declarations.
These are struct members, not function prototypes.
Quoted 1 line
Plus there's an unneeded-with-this-patch declaration in
init/main.c.
Updated patch below.
cu
Adrian
<-- snip -->
This patch adds a proper prototype for setup_arch() in init.h .
This patch is based on a patch by Ben Dooks <[email protected]>.
---
include/linux/init.h | 4 ++++ init/main.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-)
include/linux/init.h renamed from include/linux/init.h.old +4 -0
@@ -69,6 +69,10 @@/* Defined in init/main.c */ extern char saved_command_line[]; + +/* used by init/main.c */ +extern void setup_arch (char **); +#endif #ifndef MODULE
init/main.c renamed from init/main.c.old +0 -2
@@ -324,8 +324,6 @@ }__setup ("rdinit=" , rdinit_setup); -extern void setup_arch (char **); -#ifndef CONFIG_SMP #ifdef CONFIG_X86_LOCAL_APIC
Quoted 2 lines · Andrew Morton
There are already declarations of
setup_archininclude/asm-ppcandinclude/asm-powerpc. Different declarations.
There are? Grep doesn't show them to me.
Paul.