summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-09-09 13:34:22 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-09-14 04:40:13 +0200
commit6df7e1ec932a330c931ed747ed824639fb04133e (patch)
treee6e3472a306a45f72d486721f3b670021611f877 /scripts
parentexport.h, genksyms: do not make genksyms calculate CRC of trimmed symbols (diff)
downloadlinux-6df7e1ec932a330c931ed747ed824639fb04133e.tar.xz
linux-6df7e1ec932a330c931ed747ed824639fb04133e.zip
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: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 76c221dd9b2b..25036947bcb8 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -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)