drivers/macintosh: make wf_control_ops and wf_pid_param const
PATCH 1/1 drivers/macintosh: make wf_control_ops and wf_pid_param const
Make wf_control_ops const as they are only stored in the ops field of a wf_control structure, which is const.
Make wf_pid_param const as they are only used during a copy operation. Done using Coccinelle.
Signed-off-by Bhumika Goyal <[email protected]>
---
Cross compiled windfarm_smu_controls.o and windfarm_rm31.o for powerpc.
drivers/macintosh/windfarm_cpufreq_clamp.c | 2 +- drivers/macintosh/windfarm_rm31.c | 4 ++-- drivers/macintosh/windfarm_smu_controls.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/macintosh/windfarm_cpufreq_clamp.c +1 -1
@@ -63,7 +63,7 @@ static s32 clamp_max(struct wf_control *ct)return 1 ; } -static struct wf_control_ops clamp_ops = { +static const struct wf_control_ops clamp_ops = { .set_value = clamp_set, .get_value = clamp_get, .get_min = clamp_min,
drivers/macintosh/windfarm_rm31.c +2 -2
@@ -338,7 +338,7 @@ static int cpu_setup_pid(int cpu) }/* Backside/U3 fan */ -static struct wf_pid_param backside_param = { +static const struct wf_pid_param backside_param = { .interval =1 , .history_len =2 , .gd =0x00500000 ,
@@ -351,7 +351,7 @@ static int cpu_setup_pid(int cpu) };/* DIMMs temperature (clamp the backside fan) */ -static struct wf_pid_param dimms_param = { +static const struct wf_pid_param dimms_param = { .interval =1 , .history_len =20 , .gd =0 ,
drivers/macintosh/windfarm_smu_controls.c +1 -1
@@ -145,7 +145,7 @@ static s32 smu_fan_max(struct wf_control *ct)return fct->max; } -static struct wf_control_ops smu_fan_ops = { +static const struct wf_control_ops smu_fan_ops = { .set_value = smu_fan_set, .get_value = smu_fan_get, .get_min = smu_fan_min,
Signature · 1 line
1.9.1
Michael Ellerman
AppliedQuoted 6 lines · Bhumika Goyal
Make
wf_control_opsconst as they are only stored in the ops field of awf_controlstructure, which is const.
Makewf_pid_paramconst as they are only used during a copy operation. Done using Coccinelle.Signed-off-by Bhumika Goyal <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/1ad35f6e2864d9b52fe9705ede1730
cheers