* [PATCH 0/2] constify thermal_zone_of_device_ops structures
@ 2018-10-30 15:14 Julia Lawall
2018-10-30 15:14 ` [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure Julia Lawall
2018-10-30 15:15 ` [PATCH 2/2] thermal: broadcom: " Julia Lawall
0 siblings, 2 replies; 5+ messages in thread
From: Julia Lawall @ 2018-10-30 15:14 UTC (permalink / raw)
To: Zhang Rui
Cc: kernel-janitors, Eduardo Valentin, Daniel Lezcano, linux-pm,
linux-kernel, linux-arm-kernel
The thermal_zone_of_device_ops structures can be const as they are
only passed as the last argument of a thermal_zone_of_sensor_register
function and the corresponding parameter is declared as const.
Done with the help of Coccinelle.
---
drivers/thermal/armada_thermal.c | 2 +-
drivers/thermal/broadcom/brcmstb_thermal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure
2018-10-30 15:14 [PATCH 0/2] constify thermal_zone_of_device_ops structures Julia Lawall
@ 2018-10-30 15:14 ` Julia Lawall
2018-10-30 16:20 ` Daniel Lezcano
2018-10-30 15:15 ` [PATCH 2/2] thermal: broadcom: " Julia Lawall
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-10-30 15:14 UTC (permalink / raw)
To: Zhang Rui
Cc: kernel-janitors, Eduardo Valentin, Daniel Lezcano, linux-pm,
linux-kernel
The thermal_zone_of_device_ops structure can be const as it is only
passed as the last argument of devm_thermal_zone_of_sensor_register
and the corresponding parameter is declared as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/thermal/armada_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -395,7 +395,7 @@ unlock_mutex:
return ret;
}
-static struct thermal_zone_of_device_ops of_ops = {
+static const struct thermal_zone_of_device_ops of_ops = {
.get_temp = armada_get_temp,
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] thermal: broadcom: constify thermal_zone_of_device_ops structure
2018-10-30 15:14 [PATCH 0/2] constify thermal_zone_of_device_ops structures Julia Lawall
2018-10-30 15:14 ` [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure Julia Lawall
@ 2018-10-30 15:15 ` Julia Lawall
2018-10-30 16:22 ` Daniel Lezcano
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-10-30 15:15 UTC (permalink / raw)
To: Markus Mayer
Cc: kernel-janitors, bcm-kernel-feedback-list, Zhang Rui,
Eduardo Valentin, Daniel Lezcano, Brian Norris, Gregory Fong,
Florian Fainelli, linux-pm, linux-arm-kernel, linux-kernel
The thermal_zone_of_device_ops structure can be const as it is only
passed as the last argument of thermal_zone_of_sensor_register
and the corresponding parameter is declared as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
Unrelated to this change, is there a reason not to use
devm_thermal_zone_of_sensor_register?
drivers/thermal/broadcom/brcmstb_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -299,7 +299,7 @@ static int brcmstb_set_trips(void *data,
return 0;
}
-static struct thermal_zone_of_device_ops of_ops = {
+static const struct thermal_zone_of_device_ops of_ops = {
.get_temp = brcmstb_get_temp,
.set_trips = brcmstb_set_trips,
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure
2018-10-30 15:14 ` [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure Julia Lawall
@ 2018-10-30 16:20 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2018-10-30 16:20 UTC (permalink / raw)
To: Julia Lawall, Zhang Rui
Cc: kernel-janitors, Eduardo Valentin, linux-pm, linux-kernel
On 30/10/2018 16:14, Julia Lawall wrote:
> The thermal_zone_of_device_ops structure can be const as it is only
> passed as the last argument of devm_thermal_zone_of_sensor_register
> and the corresponding parameter is declared as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/thermal/armada_thermal.c | 2 +-
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
--
<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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] thermal: broadcom: constify thermal_zone_of_device_ops structure
2018-10-30 15:15 ` [PATCH 2/2] thermal: broadcom: " Julia Lawall
@ 2018-10-30 16:22 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2018-10-30 16:22 UTC (permalink / raw)
To: Julia Lawall, Markus Mayer
Cc: kernel-janitors, bcm-kernel-feedback-list, Zhang Rui,
Eduardo Valentin, Brian Norris, Gregory Fong, Florian Fainelli,
linux-pm, linux-arm-kernel, linux-kernel
On 30/10/2018 16:15, Julia Lawall wrote:
> The thermal_zone_of_device_ops structure can be const as it is only
> passed as the last argument of thermal_zone_of_sensor_register
> and the corresponding parameter is declared as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>
> Unrelated to this change, is there a reason not to use
> devm_thermal_zone_of_sensor_register?
Agree, it would make sense to use the devm* version.
> drivers/thermal/broadcom/brcmstb_thermal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -u -p a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
> --- a/drivers/thermal/broadcom/brcmstb_thermal.c
> +++ b/drivers/thermal/broadcom/brcmstb_thermal.c
> @@ -299,7 +299,7 @@ static int brcmstb_set_trips(void *data,
> return 0;
> }
>
> -static struct thermal_zone_of_device_ops of_ops = {
> +static const struct thermal_zone_of_device_ops of_ops = {
> .get_temp = brcmstb_get_temp,
> .set_trips = brcmstb_set_trips,
> };
>
--
<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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-10-30 16:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 15:14 [PATCH 0/2] constify thermal_zone_of_device_ops structures Julia Lawall
2018-10-30 15:14 ` [PATCH 1/2] thermal: armada: constify thermal_zone_of_device_ops structure Julia Lawall
2018-10-30 16:20 ` Daniel Lezcano
2018-10-30 15:15 ` [PATCH 2/2] thermal: broadcom: " Julia Lawall
2018-10-30 16:22 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).