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>
This commit is contained in:

committed by
Rusty Russell

parent
28b8d0c8f5
commit
9c27847dda
@@ -448,42 +448,42 @@ static int param_set_battery_voltage(const char *key,
|
||||
|
||||
#define param_get_battery_voltage param_get_int
|
||||
|
||||
static struct kernel_param_ops param_ops_ac_online = {
|
||||
static const struct kernel_param_ops param_ops_ac_online = {
|
||||
.set = param_set_ac_online,
|
||||
.get = param_get_ac_online,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_usb_online = {
|
||||
static const struct kernel_param_ops param_ops_usb_online = {
|
||||
.set = param_set_usb_online,
|
||||
.get = param_get_usb_online,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_status = {
|
||||
static const struct kernel_param_ops param_ops_battery_status = {
|
||||
.set = param_set_battery_status,
|
||||
.get = param_get_battery_status,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_present = {
|
||||
static const struct kernel_param_ops param_ops_battery_present = {
|
||||
.set = param_set_battery_present,
|
||||
.get = param_get_battery_present,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_technology = {
|
||||
static const struct kernel_param_ops param_ops_battery_technology = {
|
||||
.set = param_set_battery_technology,
|
||||
.get = param_get_battery_technology,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_health = {
|
||||
static const struct kernel_param_ops param_ops_battery_health = {
|
||||
.set = param_set_battery_health,
|
||||
.get = param_get_battery_health,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_capacity = {
|
||||
static const struct kernel_param_ops param_ops_battery_capacity = {
|
||||
.set = param_set_battery_capacity,
|
||||
.get = param_get_battery_capacity,
|
||||
};
|
||||
|
||||
static struct kernel_param_ops param_ops_battery_voltage = {
|
||||
static const struct kernel_param_ops param_ops_battery_voltage = {
|
||||
.set = param_set_battery_voltage,
|
||||
.get = param_get_battery_voltage,
|
||||
};
|
||||
|
Reference in New Issue
Block a user