soc: qcom: aoss: constify static struct thermal_cooling_device_ops
Subsystems (2)
PATCH 1/1 soc: qcom: aoss: constify static struct thermal_cooling_device_ops
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.
--- drivers/soc/qcom/qcom_aoss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/qcom_aoss.c +1 -1
@@ -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,
Signature · 1 line
2.34.1
Bjorn Andersson
AppliedRe: (subset) [PATCH] soc: qcom: aoss: constify static struct thermal_cooling_device_ops
Quoted 6 lines · Rikard Falkeborn
The only usage of
qmp_cooling_device_opsis to pass its address todevm_thermal_of_cooling_device_register()which takes a pointer to const structthermal_cooling_device_opsas 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,
Signature · 1 line
Bjorn Andersson <[email protected]>