module: Fix ERRORs reported by checkpatch.pl
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 13 Jun 2022 06:02:01 +0000 (08:02 +0200)
committerLuis Chamberlain <mcgrof@kernel.org>
Mon, 11 Jul 2022 17:49:14 +0000 (10:49 -0700)
commitecc726f1458e7aa50e120ff334f0a3be5cccd94c
tree404c2152837cfe5510664db6c77430bb2b5bca0f
parentae39e9ed964f8e450d0de410b5a757e19581dfc5
module: Fix ERRORs reported by checkpatch.pl

Checkpatch reports following errors:

ERROR: do not use assignment in if condition
+ if ((colon = strnchr(name, MODULE_NAME_LEN, ':')) != NULL) {

ERROR: do not use assignment in if condition
+ if ((mod = find_module_all(name, colon - name, false)) != NULL)

ERROR: do not use assignment in if condition
+ if ((ret = find_kallsyms_symbol_value(mod, name)) != 0)

ERROR: do not initialise globals to 0
+int modules_disabled = 0;

Fix them.

The following one has to remain, because the condition has to be evaluated
multiple times by the macro wait_event_interruptible_timeout().

ERROR: do not use assignment in if condition
+ if (wait_event_interruptible_timeout(module_wq,

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/module/kallsyms.c
kernel/module/main.c