Skip to content

Commit 6df7e1e

Browse files
committed
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>
1 parent 69a94ab commit 6df7e1e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,10 +2267,7 @@ static void add_depends(struct buffer *b, struct module *mod)
22672267
s->module->seen = is_vmlinux(s->module->name);
22682268

22692269
buf_printf(b, "\n");
2270-
buf_printf(b, "static const char __module_depends[]\n");
2271-
buf_printf(b, "__used\n");
2272-
buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
2273-
buf_printf(b, "\"depends=");
2270+
buf_printf(b, "MODULE_INFO(depends, \"");
22742271
for (s = mod->unres; s; s = s->next) {
22752272
const char *p;
22762273
if (!s->module)
@@ -2288,7 +2285,7 @@ static void add_depends(struct buffer *b, struct module *mod)
22882285
buf_printf(b, "%s%s", first ? "" : ",", p);
22892286
first = 0;
22902287
}
2291-
buf_printf(b, "\";\n");
2288+
buf_printf(b, "\");\n");
22922289
}
22932290

22942291
static void add_srcversion(struct buffer *b, struct module *mod)

0 commit comments

Comments
 (0)