瀏覽代碼

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>
Stephen Rothwell 10 年之前
父節點
當前提交
20bdc2cfdb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      kernel/params.c

+ 4 - 0
kernel/params.c

@@ -30,7 +30,11 @@
 static DEFINE_MUTEX(param_lock);
 static DEFINE_MUTEX(param_lock);
 
 
 /* Use the module's mutex, or if built-in use the built-in mutex */
 /* 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)
 #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)
 static inline void check_kparam_locked(struct module *mod)
 {
 {