History

modpost: use MODULE_INFO() for __module_depends

This makes *.mod.c much more readable. I confirmed depmod still produced the same modules.dep file.

Masahiro Yamada committed 7 years ago

Commit 6df7e1e1 parent 69a94ab1 file · +2 −5Browse files

Unified · Split

scripts/mod/modpost.c+2−5
@@ -2267,10 +2267,7 @@ static void add_depends(struct buffer *b, struct module *mod) · 2266 unmodified lines
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) · 11 unmodified lines
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)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t