]> git.baikalelectronics.ru Git - kernel.git/commit
module: Fix "warning: variable 'exit' set but not used"
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sun, 12 Jun 2022 15:33:20 +0000 (17:33 +0200)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 1 Jul 2022 21:45:24 +0000 (14:45 -0700)
commitee612a8f015c691cfc7f142fafefbe2a4f167ec4
tree7c4a61237a80d5dd1c727b96eed3ddb8e2f538bd
parent939cca61105e7196aa48812133e05828000fe156
module: Fix "warning: variable 'exit' set but not used"

When CONFIG_MODULE_UNLOAD is not selected, 'exit' is
set but never used.

It is not possible to replace the #ifdef CONFIG_MODULE_UNLOAD by
IS_ENABLED(CONFIG_MODULE_UNLOAD) because mod->exit doesn't exist
when CONFIG_MODULE_UNLOAD is not selected.

And because of the rcu_read_lock_sched() section it is not easy
to regroup everything in a single #ifdef. Let's regroup partially
and add missing #ifdef to completely opt out the use of
'exit' when CONFIG_MODULE_UNLOAD is not selected.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/module/main.c