[PATCH v4 04/12] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition

Kever Yang kever.yang at rock-chips.com
Wed Apr 6 16:36:35 CEST 2022


On 2022/4/4 07:06, Johan Jonker wrote:
> Not all Rockchip SoC models use the ARM arch timer.
> Call the function timer_init() only when
> CONFIG_SYS_ARCH_TIMER is available.
> Replace the ifdef call condition by IS_ENABLED
> to increase build coverage and make the code easier to read.
The commit message does not really describe the code change.
>
> Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> ---
>   arch/arm/mach-rockchip/spl.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
> index 0017ca71b0..9c83b038a6 100644
> --- a/arch/arm/mach-rockchip/spl.c
> +++ b/arch/arm/mach-rockchip/spl.c
> @@ -139,10 +139,10 @@ void board_init_f(ulong dummy)
>   	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
>   		rockchip_stimer_init();
>   
> -#ifdef CONFIG_SYS_ARCH_TIMER
> -	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
> -	timer_init();
> -#endif
> +	/* Init ARM arch timer */
> +	if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
> +		timer_init();


These two kind of code end up with the same compile output, isn't it?

This patch is no need for this series.

Thanks,
- Kever
> +
>   #if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
>   	debug("\nspl:init dram\n");
>   	ret = dram_init();


More information about the U-Boot mailing list