linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: aoss: constify static struct thermal_cooling_device_ops
@ 2021-11-28 21:03 Rikard Falkeborn
  2021-12-01 15:13 ` (subset) " Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-11-28 21:03 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson; +Cc: linux-arm-msm, linux-kernel, Rikard Falkeborn

The only usage of qmp_cooling_device_ops is to pass its address to
devm_thermal_of_cooling_device_register() which takes a pointer to const
struct thermal_cooling_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>
---
 drivers/soc/qcom/qcom_aoss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index 34acf58bbb0d..cbe5e39fdaeb 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -352,7 +352,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
 	return ret;
 }
 
-static struct thermal_cooling_device_ops qmp_cooling_device_ops = {
+static const struct thermal_cooling_device_ops qmp_cooling_device_ops = {
 	.get_max_state = qmp_cdev_get_max_state,
 	.get_cur_state = qmp_cdev_get_cur_state,
 	.set_cur_state = qmp_cdev_set_cur_state,
-- 
2.34.1


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

* Re: (subset) [PATCH] soc: qcom: aoss: constify static struct thermal_cooling_device_ops
  2021-11-28 21:03 [PATCH] soc: qcom: aoss: constify static struct thermal_cooling_device_ops Rikard Falkeborn
@ 2021-12-01 15:13 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2021-12-01 15:13 UTC (permalink / raw)
  To: Andy Gross, Rikard Falkeborn; +Cc: linux-arm-msm, linux-kernel

On Sun, 28 Nov 2021 22:03:17 +0100, Rikard Falkeborn wrote:
> The only usage of qmp_cooling_device_ops is to pass its address to
> devm_thermal_of_cooling_device_register() which takes a pointer to const
> struct thermal_cooling_device_ops as argument. Make it const to allow
> the compiler to put it in read-only memory.
> 
> 

Applied, thanks!

[1/1] soc: qcom: aoss: constify static struct thermal_cooling_device_ops
      commit: f5c3902d854744b42604359f68b42426185ed7a5

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28 21:03 [PATCH] soc: qcom: aoss: constify static struct thermal_cooling_device_ops Rikard Falkeborn
2021-12-01 15:13 ` (subset) " Bjorn Andersson

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