thermal: thermal_mmio: Constify static struct thermal_mmio_ops
Subsystems (2)
PATCH 1/1 thermal: 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.
--- drivers/thermal/thermal_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_mmio.c +1 -1
@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp)return 0 ; } -static struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_of_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, };
Signature · 1 line
2.33.0
The only usage of thermal_mmio_ops is to pass its address to
Quoted 5 lines
devm_thermal_zone_of_sensor_register(), which has a pointer to const structthermal_zone_of_device_opsas argument. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
Quoted 20 lines
--- drivers/thermal/thermal_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/thermal_mmio.c +1
-2@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp)return 0 ; } -static struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_of_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, }; --2.33.0
Rafael J. Wysocki
maintainerQuoted 16 lines · Rikard Falkeborn
The only usage of
thermal_mmio_opsis to pass its address todevm_thermal_zone_of_sensor_register(), which has a pointer to const structthermal_zone_of_device_opsas argument. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>--- drivers/thermal/thermal_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/thermal_mmio.c +0
-0
drivers/thermal/thermal_mmio.c static int thermal_mmio_get_temperature(void *private, int *temp)
Quoted 9 lines
drivers/thermal/thermal_mmio.c +1
-2@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp)return 0 ; } -static struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_of_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, }; --
I'm not sure what happened to this patch.
Daniel, are you going to pick it up?
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Rikard Falkeborn
The only usage of
thermal_mmio_opsis to pass its address todevm_thermal_zone_of_sensor_register(), which has a pointer to const structthermal_zone_of_device_opsas argument. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>--- drivers/thermal/thermal_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/thermal_mmio.c +1
-1@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp)return 0 ; } -static struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_of_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, };
Quoted 5 lines
Quoted 1 line
--
I'm not sure what happened to this patch.
Daniel, are you going to pick it up?
Yes.
I had picked also the intel ones but I'll drop them.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
[thermal: thermal/next] thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_ops
In reply to Rikard FalkebornThe following commit has been merged into the thermal/next branch of thermal:
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: 69c560d2eb3cff7ebe876cd224a3dc05852990b5 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//69c560d2eb3cff7ebe876cd224a3dc05852990b5 Author: Rikard Falkeborn <[email protected]> AuthorDate: Mon, 20 Sep 2021 22:38:49 +02:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Thu, 07 Oct 2021 15:18:31 +02:00
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.
--- drivers/thermal/thermal_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_mmio.c +1 -1
@@ -34,7 +34,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp)return 0 ; } -static struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_of_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, };