Skip to contentSkip to conversation

init.h: add missing initcall variants

PATCH In review Randy Dunlap 3 participants 3 messages Dec 2, 2013 – Dec 7, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 init.h: add missing initcall variants

From: Randy Dunlap <[email protected]>

Add missing initcall variants when building for loadable modules. This fixes this build error on powerpc allmodconfig:

drivers/tty/ehv_bytechan.c: error: type defaults to 'int' in declaration of 'console_initcall' [-Werror=implicit-int]

---
 include/linux/init.h |    2 ++
 1 file changed, 2 insertions(+)
include/linux/init.h +2 -0
@@ -286,9 +286,11 @@ void __init parse_early_options(char *cm
 #define arch_initcall(fn)		module_init(fn)
 #define subsys_initcall(fn)		module_init(fn)
 #define fs_initcall(fn)			module_init(fn)
+#define rootfs_initcall(fn)		module_init(fn)
 #define device_initcall(fn)		module_init(fn)
 #define late_initcall(fn)		module_init(fn)
 
+#define console_initcall(fn)		module_init(fn)
 #define security_initcall(fn)		module_init(fn)
 
 /* Each module must use one module_init(). */
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Add missing initcall variants when building for loadable modules. This fixes this build error on powerpc allmodconfig:

drivers/tty/ehv_bytechan.c: error: type defaults to 'int' in declaration of 'console_initcall' [-Werror=implicit-int]

However, I wonder if it makes sense to have a console_initcall in a module at all. Is it possible to load and use a console driver as a module?

#2 lore raw
Quoted 6 lines · Timur Tabi
Quoted 5 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Add missing initcall variants when building for loadable modules. This fixes this build error on powerpc allmodconfig:

Quoted 7 lines
Quoted 1 line

drivers/tty/ehv_bytechan.c: error: type defaults to 'int' in declaration of 'console_initcall' [-Werror=implicit-int]

However, I wonder if it makes sense to have a console_initcall in a module at all. Is it possible to load and use a console driver as a module?

Of course.

Its use for debugging is limited though, as you obviously won't get output from it before the module is loaded and the console is registered.

As long as it's e.g. autoloaded from an initramfs, it'll work.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds