summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_lm87_sensor.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2017-08-02 23:01:45 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2017-09-01 08:42:54 +0200
commitde854e54d79bc0ad5c45c5be50821b1c0639cb75 (patch)
tree7abb9e9efc11372c0dc4eaef38b36115792efb19 /drivers/macintosh/windfarm_lm87_sensor.c
parentpowerpc/iommu: Use permission-specific DEVICE_ATTR variants (diff)
downloadlinux-de854e54d79bc0ad5c45c5be50821b1c0639cb75.tar.xz
linux-de854e54d79bc0ad5c45c5be50821b1c0639cb75.zip
powerpc/macintosh: constify wf_sensor_ops structures
The wf_sensor_ops structures are only stored in the ops field of a wf_sensor structure, which is declared as const. Thus the wf_sensor_ops structures themselves can be const. Done with the help of Coccinelle. // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct wf_sensor_ops i@p = { ... }; @ok1@ identifier r.i; struct wf_sensor s; position p; @@ s.ops = &i@p @ok2@ identifier r.i; struct wf_sat_sensor s; position p; @@ s.sens.ops = &i@p @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct wf_sensor_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct wf_sensor_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/macintosh/windfarm_lm87_sensor.c')
-rw-r--r--drivers/macintosh/windfarm_lm87_sensor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c
index 913c4bfeef94..35aa571d498a 100644
--- a/drivers/macintosh/windfarm_lm87_sensor.c
+++ b/drivers/macintosh/windfarm_lm87_sensor.c
@@ -91,7 +91,7 @@ static void wf_lm87_release(struct wf_sensor *sr)
kfree(lm);
}
-static struct wf_sensor_ops wf_lm87_ops = {
+static const struct wf_sensor_ops wf_lm87_ops = {
.get_value = wf_lm87_get,
.release = wf_lm87_release,
.owner = THIS_MODULE,