diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/init.h | 16 | ||||
| -rw-r--r-- | include/linux/module.h | 12 |
2 files changed, 6 insertions, 22 deletions
diff --git a/include/linux/init.h b/include/linux/init.h index 52db706d0ed0..e2bf29a635bf 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -125,14 +125,6 @@ extern struct kernel_param __setup_start, __setup_end; */ #define module_exit(x) __exitcall(x); -/** - * no_module_init - code needs no initialization. - * - * The equivalent of declaring an empty init function which returns 0. - * Every module must have exactly one module_init() or no_module_init - * invocation. */ -#define no_module_init - #else /* MODULE */ /* Don't use these in modules, but some people do... */ @@ -144,11 +136,6 @@ extern struct kernel_param __setup_start, __setup_end; #define device_initcall(fn) module_init(fn) #define late_initcall(fn) module_init(fn) -/* Each module knows its own name. */ -#define __DEFINE_MODULE_NAME \ - char __module_name[] __attribute__((section(".modulename"))) = \ - __stringify(KBUILD_MODNAME) - /* These macros create a dummy inline: gcc 2.9x does not count alias as usage, hence the `unused function' warning when __init functions are declared static. We use the dummy __*_module_inline functions @@ -157,13 +144,10 @@ extern struct kernel_param __setup_start, __setup_end; /* Each module must use one module_init(), or one no_module_init */ #define module_init(initfn) \ - __DEFINE_MODULE_NAME; \ static inline initcall_t __inittest(void) \ { return initfn; } \ int __initfn(void) __attribute__((alias(#initfn))); -#define no_module_init __DEFINE_MODULE_NAME - /* This is only required if you want to be unloadable. */ #define module_exit(exitfn) \ static inline exitcall_t __exittest(void) \ diff --git a/include/linux/module.h b/include/linux/module.h index 7729a4e10fb9..0362a206ccd9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -46,6 +46,11 @@ struct kernel_symbol #ifdef MODULE +#ifdef KBUILD_MODNAME +static const char __module_name[MODULE_NAME_LEN] __attribute__((section(".gnu.linkonce.modname"))) = \ + __stringify(KBUILD_MODNAME); +#endif + /* For replacement modutils, use an alias not a pointer. */ #define MODULE_GENERIC_TABLE(gtype,name) \ static const unsigned long __module_##gtype##_size \ @@ -315,12 +320,7 @@ extern int module_dummy_usage; /* Old-style "I'll just call it init_module and it'll be run at insert". Use module_init(myroutine) instead. */ #ifdef MODULE -/* Used as "int init_module(void) { ... }". Get funky to insert modname. */ -#define init_module(voidarg) \ - __initfn(void); \ - char __module_name[] __attribute__((section(".modulename"))) = \ - __stringify(KBUILD_MODNAME); \ - int __initfn(void) +#define init_module(voidarg) __initfn(void) #define cleanup_module(voidarg) __exitfn(void) #endif |
