[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211128204158.19544-1-rikard.falkeborn@gmail.com>
Date: Sun, 28 Nov 2021 21:41:58 +0100
From: Rikard Falkeborn <rikard.falkeborn@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
Kai Song <songkai01@...pur.com>,
Jing Yangyang <jing.yangyang@....com.cn>,
Rikard Falkeborn <rikard.falkeborn@...il.com>
Subject: [PATCH] memory: tegra: Constify struct thermal_cooling_device_ops
The only usage of tegra210_emc_cd_ops is to pass its address to
devm_thermal_of_cooling_device_register() which is a pointer to const
struct thermal_cooling_device_ops. Make it const to allow the compiler
to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>
---
drivers/memory/tegra/tegra210-emc-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
index 13584f9317a4..cbe1a7723514 100644
--- a/drivers/memory/tegra/tegra210-emc-core.c
+++ b/drivers/memory/tegra/tegra210-emc-core.c
@@ -711,7 +711,7 @@ static int tegra210_emc_cd_set_state(struct thermal_cooling_device *cd,
return 0;
}
-static struct thermal_cooling_device_ops tegra210_emc_cd_ops = {
+static const struct thermal_cooling_device_ops tegra210_emc_cd_ops = {
.get_max_state = tegra210_emc_cd_max_state,
.get_cur_state = tegra210_emc_cd_get_state,
.set_cur_state = tegra210_emc_cd_set_state,
--
2.34.1
Powered by blists - more mailing lists