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
2267 s->module->seen = is_vmlinux(s->module->name);2267 s->module->seen = is_vmlinux(s->module->name);
2268 2268
2269 buf_printf(b, "\n");2269 buf_printf(b, "\n");
2270 buf_printf(b, "static const char __module_depends[]\n");2270 buf_printf(b, "MODULE_INFO(depends, \"");
2271 buf_printf(b, "__used\n");
2272 buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
2273 buf_printf(b, "\"depends=");
2274 for (s = mod->unres; s; s = s->next) {2271 for (s = mod->unres; s; s = s->next) {
2275 const char *p;2272 const char *p;
2276 if (!s->module)2273 if (!s->module)
@@ -2288,7 +2285,7 @@ static void add_depends(struct buffer *b, struct module *mod) · 11 unmodified lines
2288 buf_printf(b, "%s%s", first ? "" : ",", p);2285 buf_printf(b, "%s%s", first ? "" : ",", p);
2289 first = 0;2286 first = 0;
2290 }2287 }
2291 buf_printf(b, "\";\n");2288 buf_printf(b, "\");\n");
2292}2289}
2293 2290
2294static void add_srcversion(struct buffer *b, struct module *mod)2291static 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