[PATCH 1/2] clocksource/drivers/imx-sysctr: mark two variable with __ro_after_init

Kees Cook keescook at chromium.org
Thu Dec 2 16:05:19 PST 2021


On Wed, Dec 01, 2021 at 08:50:29PM +0800, Peng Fan (OSS) wrote:
> 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>

Always nice to get more of these. :)

Reviewed-by: Kees Cook <keescook at chromium.org>

Thanks!

-Kees

> ---
>  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
> 

-- 
Kees Cook



More information about the linux-arm-kernel mailing list