From: Steven Rostedt Date: Tue, 20 Aug 2013 06:03:20 +0000 (+0930) Subject: module/lsm: Have apparmor module parameters work with no args X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5265fc6219ddbf8dfc9b18223448a4997fb06eae;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git module/lsm: Have apparmor module parameters work with no args The apparmor module parameters for param_ops_aabool and param_ops_aalockpolicy are both based off of the param_ops_bool, and can handle a NULL value passed in as val. Have it enable the new KERNEL_PARAM_FL_NOARGS flag to allow the parameters to be set without having to state "=y" or "=1". Cc: John Johansen Signed-off-by: Steven Rostedt Signed-off-by: Rusty Russell --- diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 2e2a0dd4a73f..e3a704c75ef6 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -666,6 +666,7 @@ static int param_set_aabool(const char *val, const struct kernel_param *kp); static int param_get_aabool(char *buffer, const struct kernel_param *kp); #define param_check_aabool param_check_bool static struct kernel_param_ops param_ops_aabool = { + .flags = KERNEL_PARAM_FL_NOARG, .set = param_set_aabool, .get = param_get_aabool }; @@ -682,6 +683,7 @@ static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp); #define param_check_aalockpolicy param_check_bool static struct kernel_param_ops param_ops_aalockpolicy = { + .flags = KERNEL_PARAM_FL_NOARG, .set = param_set_aalockpolicy, .get = param_get_aalockpolicy };