aboutsummaryrefslogtreecommitdiffstats
path: root/security/apparmor
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-05-26 21:39:38 -0400
committerRusty Russell <rusty@rustcorp.com.au>2015-05-27 22:02:10 -0400
commit9c27847dda9cfae7c273cde62becf364f9fa9ea3 (patch)
treefe0bcaa54807ea65b32f832f0b8afa970a803861 /security/apparmor
parent28b8d0c8f560300836dff352348e513cdf328e50 (diff)
kernel/params: constify struct kernel_param_ops uses
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/lsm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index e5f1561439db..45eb96d1e1d9 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -667,7 +667,7 @@ static struct security_operations apparmor_ops = {
667static int param_set_aabool(const char *val, const struct kernel_param *kp); 667static int param_set_aabool(const char *val, const struct kernel_param *kp);
668static int param_get_aabool(char *buffer, const struct kernel_param *kp); 668static int param_get_aabool(char *buffer, const struct kernel_param *kp);
669#define param_check_aabool param_check_bool 669#define param_check_aabool param_check_bool
670static struct kernel_param_ops param_ops_aabool = { 670static const struct kernel_param_ops param_ops_aabool = {
671 .flags = KERNEL_PARAM_OPS_FL_NOARG, 671 .flags = KERNEL_PARAM_OPS_FL_NOARG,
672 .set = param_set_aabool, 672 .set = param_set_aabool,
673 .get = param_get_aabool 673 .get = param_get_aabool
@@ -676,7 +676,7 @@ static struct kernel_param_ops param_ops_aabool = {
676static int param_set_aauint(const char *val, const struct kernel_param *kp); 676static int param_set_aauint(const char *val, const struct kernel_param *kp);
677static int param_get_aauint(char *buffer, const struct kernel_param *kp); 677static int param_get_aauint(char *buffer, const struct kernel_param *kp);
678#define param_check_aauint param_check_uint 678#define param_check_aauint param_check_uint
679static struct kernel_param_ops param_ops_aauint = { 679static const struct kernel_param_ops param_ops_aauint = {
680 .set = param_set_aauint, 680 .set = param_set_aauint,
681 .get = param_get_aauint 681 .get = param_get_aauint
682}; 682};
@@ -684,7 +684,7 @@ static struct kernel_param_ops param_ops_aauint = {
684static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp); 684static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp);
685static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp); 685static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
686#define param_check_aalockpolicy param_check_bool 686#define param_check_aalockpolicy param_check_bool
687static struct kernel_param_ops param_ops_aalockpolicy = { 687static const struct kernel_param_ops param_ops_aalockpolicy = {
688 .flags = KERNEL_PARAM_OPS_FL_NOARG, 688 .flags = KERNEL_PARAM_OPS_FL_NOARG,
689 .set = param_set_aalockpolicy, 689 .set = param_set_aalockpolicy,
690 .get = param_get_aalockpolicy 690 .get = param_get_aalockpolicy