summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-11-23 16:57:21 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-12-01 22:21:58 +0900
commitd2665ca8e3310d045b62397590ab54dc485e035e (patch)
tree700be1f04bbd9611daaae860ed06e74e6a1a7366 /scripts/mod
parentf880eea68fe593342fa6e09be9bb661f3c297aec (diff)
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: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 3aab410f020e..eedc2742dc8e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2241,15 +2241,15 @@ static int add_versions(struct buffer *b, struct module *mod)
return err;
}
-static void add_depends(struct buffer *b, struct module *mod,
- struct module *modules)
+static void add_depends(struct buffer *b, struct module *mod)
{
struct symbol *s;
- struct module *m;
int first = 1;
- for (m = modules; m; m = m->next)
- m->seen = is_vmlinux(m->name);
+ /* Clear ->seen flag of modules that own symbols needed by this. */
+ 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, "static const char __module_depends[]\n");
@@ -2518,7 +2518,7 @@ int main(int argc, char **argv)
add_retpoline(&buf);
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
- add_depends(&buf, mod, modules);
+ add_depends(&buf, mod);
add_moddevtable(&buf, mod);
add_srcversion(&buf, mod);