drivers/macintosh: Make wf_control_ops and wf_pid_param const
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 11 Aug 2017 17:38:45 +0000 (23:08 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Aug 2017 11:57:56 +0000 (21:57 +1000)
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 <bhumirks@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/macintosh/windfarm_cpufreq_clamp.c
drivers/macintosh/windfarm_rm31.c
drivers/macintosh/windfarm_smu_controls.c

index 72d1fdfe02a5bfbffc56902eecdf7fc89ca052cb..2626990331dc2607b2e4711e3fa7aed2d5bd86a3 100644 (file)
@@ -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,
index bdfcb8a8bfbb45004090ee9672c897cf5cf02db3..a0cd9c7f98351553625b62f63f5dcd03c8b95df5 100644 (file)
@@ -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 struct wf_pid_param backside_param = {
 };
 
 /* 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,
index c155a54e8638f65d5da0b1a1507f9b27bfc222a5..d174c74373371b8ca533150767cdf12fc224660c 100644 (file)
@@ -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,