Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_ops

The only usage of thermal_mmio_ops is to pass its address to
devm_thermal_zone_of_sensor_register(), which has a pointer to const
struct thermal_zone_of_device_ops as argument. Make it const to allow
the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Talel Shenhar <talel@amazon.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210920203849.32136-1-rikard.falkeborn@gmail.com

authored by

Rikard Falkeborn and committed by
Daniel Lezcano
69c560d2 5816b3e6

+1 -1
+1 -1
drivers/thermal/thermal_mmio.c
··· 34 34 return 0; 35 35 } 36 36 37 - static struct thermal_zone_of_device_ops thermal_mmio_ops = { 37 + static const struct thermal_zone_of_device_ops thermal_mmio_ops = { 38 38 .get_temp = thermal_mmio_get_temperature, 39 39 }; 40 40