Commit 7fedac96 authored by Masahiro Yamada's avatar Masahiro Yamada

modpost: merge add_{intree_flag,retpoline,staging_flag} to add_header

add_intree_flag(), add_retpoline(), and add_staging_flag() are small
enough to be merged into add_header().
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
parent 5d53508d
...@@ -2243,25 +2243,17 @@ static void add_header(struct buffer *b, struct module *mod) ...@@ -2243,25 +2243,17 @@ static void add_header(struct buffer *b, struct module *mod)
"#endif\n"); "#endif\n");
buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n"); buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n");
buf_printf(b, "};\n"); buf_printf(b, "};\n");
}
static void add_intree_flag(struct buffer *b, int is_intree) if (!external_module)
{
if (is_intree)
buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
}
/* Cannot check for assembler */ buf_printf(b,
static void add_retpoline(struct buffer *b) "\n"
{ "#ifdef CONFIG_RETPOLINE\n"
buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); "MODULE_INFO(retpoline, \"Y\");\n"
buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); "#endif\n");
buf_printf(b, "#endif\n");
}
static void add_staging_flag(struct buffer *b, const char *name) if (strstarts(mod->name, "drivers/staging"))
{
if (strstarts(name, "drivers/staging"))
buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
} }
...@@ -2577,9 +2569,6 @@ int main(int argc, char **argv) ...@@ -2577,9 +2569,6 @@ int main(int argc, char **argv)
check_exports(mod); check_exports(mod);
add_header(&buf, mod); add_header(&buf, mod);
add_intree_flag(&buf, !external_module);
add_retpoline(&buf);
add_staging_flag(&buf, mod->name);
add_versions(&buf, mod); add_versions(&buf, mod);
add_depends(&buf, mod); add_depends(&buf, mod);
add_moddevtable(&buf, mod); add_moddevtable(&buf, mod);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment