aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2025-05-02 16:12:05 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2025-05-25 18:00:52 +0900
commit6b91ff002c67b2502009f99115c4b7fe5b7b8248 (patch)
treefe34faa899d2a3992333cbac4efcfe99acd1ae52 /scripts
parentLinux 6.15-rc7 (diff)
downloadlinux-rng-6b91ff002c67b2502009f99115c4b7fe5b7b8248.tar.xz
linux-rng-6b91ff002c67b2502009f99115c4b7fe5b7b8248.zip
modpost: Use for() loop
Slight cleanup by using a for() loop instead of while(). This makes it clearer what is the iteration and what is the actual work done. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index be89921d60b6..2d1c059bf6cf 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1595,12 +1595,10 @@ static void read_symbols(const char *modname)
license = get_next_modinfo(&info, "license", license);
}
- namespace = get_modinfo(&info, "import_ns");
- while (namespace) {
+ for (namespace = get_modinfo(&info, "import_ns");
+ namespace;
+ namespace = get_next_modinfo(&info, "import_ns", namespace))
add_namespace(&mod->imported_namespaces, namespace);
- namespace = get_next_modinfo(&info, "import_ns",
- namespace);
- }
if (!get_modinfo(&info, "description"))
warn("missing MODULE_DESCRIPTION() in %s\n", modname);