Commit 6df7e1ec authored by Masahiro Yamada's avatar Masahiro Yamada

modpost: use MODULE_INFO() for __module_depends

This makes *.mod.c much more readable. I confirmed depmod still
produced the same modules.dep file.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 69a94abb
......@@ -2267,10 +2267,7 @@ static void add_depends(struct buffer *b, struct module *mod)
s->module->seen = is_vmlinux(s->module->name);
buf_printf(b, "\n");
buf_printf(b, "static const char __module_depends[]\n");
buf_printf(b, "__used\n");
buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
buf_printf(b, "\"depends=");
buf_printf(b, "MODULE_INFO(depends, \"");
for (s = mod->unres; s; s = s->next) {
const char *p;
if (!s->module)
......@@ -2288,7 +2285,7 @@ static void add_depends(struct buffer *b, struct module *mod)
buf_printf(b, "%s%s", first ? "" : ",", p);
first = 0;
}
buf_printf(b, "\";\n");
buf_printf(b, "\");\n");
}
static void add_srcversion(struct buffer *b, struct module *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