linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: constify static struct cooling_ops
@ 2021-11-28 20:19 Rikard Falkeborn
  2021-11-29 19:02 ` Christian Gmeiner
  2021-12-01 12:30 ` Lucas Stach
  0 siblings, 2 replies; 3+ messages in thread
From: Rikard Falkeborn @ 2021-11-28 20:19 UTC (permalink / raw)
  To: Lucas Stach, David Airlie, Daniel Vetter
  Cc: Russell King, Christian Gmeiner, etnaviv, dri-devel,
	linux-kernel, Rikard Falkeborn

The only usage of cooling_ops is to pass its address to
thermal_of_cooling_device_register(), which takes a pointer to const
struct thermal_cooling_device_ops as input. Make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 06bde46df451..37018bc55810 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1658,7 +1658,7 @@ etnaviv_gpu_cooling_set_cur_state(struct thermal_cooling_device *cdev,
 	return 0;
 }
 
-static struct thermal_cooling_device_ops cooling_ops = {
+static const struct thermal_cooling_device_ops cooling_ops = {
 	.get_max_state = etnaviv_gpu_cooling_get_max_state,
 	.get_cur_state = etnaviv_gpu_cooling_get_cur_state,
 	.set_cur_state = etnaviv_gpu_cooling_set_cur_state,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/etnaviv: constify static struct cooling_ops
  2021-11-28 20:19 [PATCH] drm/etnaviv: constify static struct cooling_ops Rikard Falkeborn
@ 2021-11-29 19:02 ` Christian Gmeiner
  2021-12-01 12:30 ` Lucas Stach
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Gmeiner @ 2021-11-29 19:02 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Lucas Stach, David Airlie, Daniel Vetter, Russell King,
	The etnaviv authors, DRI mailing list, LKML

Am So., 28. Nov. 2021 um 21:20 Uhr schrieb Rikard Falkeborn
<rikard.falkeborn@gmail.com>:
>
> The only usage of cooling_ops is to pass its address to
> thermal_of_cooling_device_register(), which takes a pointer to const
> struct thermal_cooling_device_ops as input. Make it const to allow the
> compiler to put it in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 06bde46df451..37018bc55810 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1658,7 +1658,7 @@ etnaviv_gpu_cooling_set_cur_state(struct thermal_cooling_device *cdev,
>         return 0;
>  }
>
> -static struct thermal_cooling_device_ops cooling_ops = {
> +static const struct thermal_cooling_device_ops cooling_ops = {
>         .get_max_state = etnaviv_gpu_cooling_get_max_state,
>         .get_cur_state = etnaviv_gpu_cooling_get_cur_state,
>         .set_cur_state = etnaviv_gpu_cooling_set_cur_state,
> --
> 2.34.1
>


-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info/privacypolicy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/etnaviv: constify static struct cooling_ops
  2021-11-28 20:19 [PATCH] drm/etnaviv: constify static struct cooling_ops Rikard Falkeborn
  2021-11-29 19:02 ` Christian Gmeiner
@ 2021-12-01 12:30 ` Lucas Stach
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2021-12-01 12:30 UTC (permalink / raw)
  To: Rikard Falkeborn, David Airlie, Daniel Vetter
  Cc: linux-kernel, etnaviv, Christian Gmeiner, dri-devel, Russell King

Am Sonntag, dem 28.11.2021 um 21:19 +0100 schrieb Rikard Falkeborn:
> The only usage of cooling_ops is to pass its address to
> thermal_of_cooling_device_register(), which takes a pointer to const
> struct thermal_cooling_device_ops as input. Make it const to allow the
> compiler to put it in read-only memory.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Applied to my etnaviv/next branch.

Regards,
Lucas

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 06bde46df451..37018bc55810 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1658,7 +1658,7 @@ etnaviv_gpu_cooling_set_cur_state(struct thermal_cooling_device *cdev,
>  	return 0;
>  }
>  
> -static struct thermal_cooling_device_ops cooling_ops = {
> +static const struct thermal_cooling_device_ops cooling_ops = {
>  	.get_max_state = etnaviv_gpu_cooling_get_max_state,
>  	.get_cur_state = etnaviv_gpu_cooling_get_cur_state,
>  	.set_cur_state = etnaviv_gpu_cooling_set_cur_state,



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-01 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28 20:19 [PATCH] drm/etnaviv: constify static struct cooling_ops Rikard Falkeborn
2021-11-29 19:02 ` Christian Gmeiner
2021-12-01 12:30 ` Lucas Stach

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).