[PATCH 1/2] clocksource/drivers/imx-sysctr: mark two variable with __ro_after_init
Peng Fan (OSS)
peng.fan at oss.nxp.com
Wed Dec 1 04:50:29 PST 2021
From: Peng Fan <peng.fan at nxp.com>
sys_ctr_base and cmpcr will not be updated after init, so mark
as __ro_after_init.
Cc: Kees Cook <keescook at chromium.org>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
drivers/clocksource/timer-imx-sysctr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c
index 18b90fc56bfc..2b309af11266 100644
--- a/drivers/clocksource/timer-imx-sysctr.c
+++ b/drivers/clocksource/timer-imx-sysctr.c
@@ -20,8 +20,8 @@
#define SYS_CTR_CLK_DIV 0x3
-static void __iomem *sys_ctr_base;
-static u32 cmpcr;
+static void __iomem *sys_ctr_base __ro_after_init;
+static u32 cmpcr __ro_after_init;
static void sysctr_timer_enable(bool enable)
{
--
2.25.1
More information about the linux-arm-kernel
mailing list