summaryrefslogtreecommitdiffstats
path: root/kernel/module/main.c
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-19 14:27:37 -0700
committerLuis Chamberlain <mcgrof@kernel.org>2023-03-24 11:05:15 -0700
commit1e684172358453df1cb783d7c101a09ff08ceee1 (patch)
treef938bd85a32c0b1f4543d768d4b06681b04bdda0 /kernel/module/main.c
parentfeb5b784a26363b690f618213450faf244c1c58e (diff)
downloadlinux-stable-1e684172358453df1cb783d7c101a09ff08ceee1.tar.gz
linux-stable-1e684172358453df1cb783d7c101a09ff08ceee1.tar.bz2
linux-stable-1e684172358453df1cb783d7c101a09ff08ceee1.zip
module: add a for_each_modinfo_entry()
Add a for_each_modinfo_entry() to make it easier to read and use. This produces no functional changes but makes this code easiert to read as we are used to with loops in the kernel and trims more lines of code. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/module/main.c')
-rw-r--r--kernel/module/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c
index ebb5e6b92a48..427284ab31f1 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1075,12 +1075,9 @@ static int verify_namespace_is_imported(const struct load_info *info,
namespace = kernel_symbol_namespace(sym);
if (namespace && namespace[0]) {
- imported_namespace = get_modinfo(info, "import_ns");
- while (imported_namespace) {
+ for_each_modinfo_entry(imported_namespace, info, "import_ns") {
if (strcmp(namespace, imported_namespace) == 0)
return 0;
- imported_namespace = get_next_modinfo(
- info, "import_ns", imported_namespace);
}
#ifdef CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
pr_warn(