提交 d2665ca8 编写于 作者: M Masahiro Yamada

modpost: refactor seen flag clearing in add_depends()

You do not need to iterate over all modules for resetting ->seen flag
because add_depends() is only interested in modules that export symbols
referenced from the given 'mod'.

This also avoids shadowing the 'modules' parameter of add_depends().
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 f880eea6
...@@ -2241,15 +2241,15 @@ static int add_versions(struct buffer *b, struct module *mod) ...@@ -2241,15 +2241,15 @@ static int add_versions(struct buffer *b, struct module *mod)
return err; return err;
} }
static void add_depends(struct buffer *b, struct module *mod, static void add_depends(struct buffer *b, struct module *mod)
struct module *modules)
{ {
struct symbol *s; struct symbol *s;
struct module *m;
int first = 1; int first = 1;
for (m = modules; m; m = m->next) /* Clear ->seen flag of modules that own symbols needed by this. */
m->seen = is_vmlinux(m->name); for (s = mod->unres; s; s = s->next)
if (s->module)
s->module->seen = is_vmlinux(s->module->name);
buf_printf(b, "\n"); buf_printf(b, "\n");
buf_printf(b, "static const char __module_depends[]\n"); buf_printf(b, "static const char __module_depends[]\n");
...@@ -2518,7 +2518,7 @@ int main(int argc, char **argv) ...@@ -2518,7 +2518,7 @@ int main(int argc, char **argv)
add_retpoline(&buf); add_retpoline(&buf);
add_staging_flag(&buf, mod->name); add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod); err |= add_versions(&buf, mod);
add_depends(&buf, mod, modules); add_depends(&buf, mod);
add_moddevtable(&buf, mod); add_moddevtable(&buf, mod);
add_srcversion(&buf, mod); add_srcversion(&buf, mod);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册