2012-06-14 22:01:15

by Jim Cromie

[permalink] [raw]
Subject: [PATCH] init: add comments to keep initcall-names in sync with initcall levels

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]>
---
include/linux/init.h | 3 ++-
init/main.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index 6b95109..5e664f6 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -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)

@@ -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)
diff --git a/init/main.c b/init/main.c
index b5cc0a7..7a74087 100644
--- a/init/main.c
+++ b/init/main.c
@@ -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",
--
1.7.10.2


2012-06-15 10:28:48

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] init: add comments to keep initcall-names in sync with initcall levels

On Thu, Jun 14, 2012 at 04:00:59PM -0600, Jim Cromie wrote:
> 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]>

This time I actually build-tested it.

Acked-by: Borislav Petkov <[email protected]>

Thanks.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

2012-06-18 06:58:00

by Rusty Russell

[permalink] [raw]
Subject: Re: [PATCH] init: add comments to keep initcall-names in sync with initcall levels

On Fri, 15 Jun 2012 12:29:06 +0200, Borislav Petkov <[email protected]> wrote:
> On Thu, Jun 14, 2012 at 04:00:59PM -0600, Jim Cromie wrote:
> > 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]>
>
> This time I actually build-tested it.
>
> Acked-by: Borislav Petkov <[email protected]>
>
> Thanks.

Applied.

Thanks,
Rusty.