Skip to content

Commit 6b91ff0

Browse files
Peter Zijlstramasahir0y
authored andcommitted
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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent a5806cd commit 6b91ff0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/mod/modpost.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,12 +1595,10 @@ static void read_symbols(const char *modname)
15951595
license = get_next_modinfo(&info, "license", license);
15961596
}
15971597

1598-
namespace = get_modinfo(&info, "import_ns");
1599-
while (namespace) {
1598+
for (namespace = get_modinfo(&info, "import_ns");
1599+
namespace;
1600+
namespace = get_next_modinfo(&info, "import_ns", namespace))
16001601
add_namespace(&mod->imported_namespaces, namespace);
1601-
namespace = get_next_modinfo(&info, "import_ns",
1602-
namespace);
1603-
}
16041602

16051603
if (!get_modinfo(&info, "description"))
16061604
warn("missing MODULE_DESCRIPTION() in %s\n", modname);

0 commit comments

Comments
 (0)