diff mbox series

soc: qcom: aoss: constify static struct thermal_cooling_device_ops

Message ID 20211128210317.25504-1-rikard.falkeborn@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series soc: qcom: aoss: constify static struct thermal_cooling_device_ops | expand

Commit Message

Rikard Falkeborn Nov. 28, 2021, 9:03 p.m. UTC
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(-)

Comments

Bjorn Andersson Dec. 1, 2021, 3:13 p.m. UTC | #1
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,
diff mbox series

Patch

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,