[PATCH] armv8: fix Clang warning on writing 32-bit variable to a 64-bit register
Ilias Apalodimas
ilias.apalodimas at linaro.org
Fri May 30 16:13:18 CEST 2025
On Wed, 28 May 2025 at 00:04, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Clang is stricter than GCC when it comes to inline assembly and expects the
> register to be written with explicitly same type of variable.
>
> Fixes: c0e1775a867c ("armv8: Add arch-specific sysinfo platform driver")
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> arch/arm/cpu/armv8/sysinfo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/cpu/armv8/sysinfo.c b/arch/arm/cpu/armv8/sysinfo.c
> index 850142da37d..ff0abee4c6b 100644
> --- a/arch/arm/cpu/armv8/sysinfo.c
> +++ b/arch/arm/cpu/armv8/sysinfo.c
> @@ -134,7 +134,7 @@ int sysinfo_get_cache_info(u8 level, struct cache_info *cinfo)
>
> /* Select cache level */
> csselr_el1 = (level << 1);
> - asm volatile("msr csselr_el1, %0" : : "r" (csselr_el1));
> + asm volatile("msr csselr_el1, %0" : : "r" ((u64)csselr_el1));
>
> /* Read CCSIDR_EL1 */
> asm volatile("mrs %0, ccsidr_el1" : "=r" (creg.data));
> --
> 2.25.1
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
More information about the U-Boot
mailing list