module: add core_param_unsafe
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 30 Mar 2015 23:20:09 +0000 (16:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2015 07:25:25 +0000 (00:25 -0700)
Similarly to module_param_unsafe(), add the helper to be used by core
code wishing to expose unsafe debugging or testing parameters that taint
the kernel when set.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/moduleparam.h

index 13923709d30d0a7b38055f5f9d474f0a86afa930..6480dcaca275b62541964ebfe390f0c0da8d371f 100644 (file)
@@ -310,6 +310,15 @@ static inline void __kernel_param_unlock(void)
 #define core_param(name, var, type, perm)                              \
        param_check_##type(name, &(var));                               \
        __module_param_call("", name, &param_ops_##type, &var, perm, -1, 0)
+
+/**
+ * core_param_unsafe - same as core_param but taints kernel
+ */
+#define core_param_unsafe(name, var, type, perm)               \
+       param_check_##type(name, &(var));                               \
+       __module_param_call("", name, &param_ops_##type, &var, perm,    \
+                           -1, KERNEL_PARAM_FL_UNSAFE)
+
 #endif /* !MODULE */
 
 /**