]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
modpost: use MODULE_INFO() for __module_depends
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 9 Sep 2019 11:34:22 +0000 (20:34 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 14 Sep 2019 02:40:13 +0000 (11:40 +0900)
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>
scripts/mod/modpost.c

index 76c221dd9b2b62d39037a75c8bd36091b4829de1..25036947bcb8903dc116d87379ff5354bb7e4400 100644 (file)
@@ -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)