From e7cfcccd8c38ba674240636d882da879c904296a Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sat, 8 Aug 2026 22:23:33 +0200 Subject: [PATCH] thermal/drivers/imx9: Constify struct thermal_zone_device_ops 'struct thermal_zone_device_ops' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 8567 2144 0 10711 29d7 drivers/thermal/imx91_thermal.o After: ===== text data bss dec hex filename 8695 2016 0 10711 29d7 drivers/thermal/imx91_thermal.o Signed-off-by: Christophe JAILLET Signed-off-by: Daniel Lezcano Reviewed-by: Frank Li Link: https://patch.msgid.link/5cce9ea713edcf2aa3c0efd5d31e9d9fd9f40a88.1786220585.git.christophe.jaillet@wanadoo.fr --- drivers/thermal/imx91_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_thermal.c index 274eee303142..196ee20fce1e 100644 --- a/drivers/thermal/imx91_thermal.c +++ b/drivers/thermal/imx91_thermal.c @@ -225,7 +225,7 @@ static int imx91_tmu_change_mode(struct thermal_zone_device *tz, enum thermal_de return 0; } -static struct thermal_zone_device_ops tmu_tz_ops = { +static const struct thermal_zone_device_ops tmu_tz_ops = { .get_temp = imx91_tmu_get_temp, .change_mode = imx91_tmu_change_mode, .set_trips = imx91_tmu_set_trips,