Skip to content

Commit

Permalink
init: add comments to keep initcall-names in sync with initcall levels
Browse files Browse the repository at this point in the history
main.c has initcall_level_names[] for parse_args to print in debug messages,
add comments to keep them in sync with initcalls defined in init.h.

Also add "loadable" into comment re not using *_initcall macros in
modules, to disambiguate from kernel/params.c and other builtins.

Signed-off-by: Jim Cromie <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
jimc authored and rustyrussell committed Jul 26, 2012
1 parent c777ad6 commit 96263d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ extern bool initcall_debug;
* initializes variables that couldn't be statically initialized.
*
* This only exists for built-in code, not for modules.
* Keep main.c:initcall_level_names[] in sync.
*/
#define pure_initcall(fn) __define_initcall("0",fn,0)

Expand Down Expand Up @@ -280,7 +281,7 @@ void __init parse_early_options(char *cmdline);

#else /* MODULE */

/* Don't use these in modules, but some people do... */
/* Don't use these in loadable modules, but some people do... */
#define early_initcall(fn) module_init(fn)
#define core_initcall(fn) module_init(fn)
#define postcore_initcall(fn) module_init(fn)
Expand Down
1 change: 1 addition & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ static initcall_t *initcall_levels[] __initdata = {
__initcall_end,
};

/* Keep these in sync with initcalls in include/linux/init.h */
static char *initcall_level_names[] __initdata = {
"early",
"core",
Expand Down

0 comments on commit 96263d2

Please sign in to comment.