summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2015-06-26 06:19:19 +0300
committerRusty Russell <rusty@rustcorp.com.au>2015-06-28 08:20:12 +0300
commit20bdc2cfdbc484777b30b96fcdbb8994038f3ce1 (patch)
treed7d8e0b68d7dfcb7c41ca72083d3aa8f02a46613 /kernel
parentcf2fde7b39e9446e2af015215d7fb695781af0c1 (diff)
downloadlinux-20bdc2cfdbc484777b30b96fcdbb8994038f3ce1.tar.xz
modules: only use mod->param_lock if CONFIG_MODULES
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/params.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/params.c b/kernel/params.c
index faa461c16f12..adc0bbc06cc5 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -30,7 +30,11 @@
static DEFINE_MUTEX(param_lock);
/* Use the module's mutex, or if built-in use the built-in mutex */
+#ifdef CONFIG_MODULES
#define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
+#else
+#define KPARAM_MUTEX(mod) (&param_lock)
+#endif
static inline void check_kparam_locked(struct module *mod)
{