[PATCH v3] arm: fix clang build warning in include/asm/memory.h

Linus Walleij linus.walleij at linaro.org
Tue Apr 16 06:36:20 PDT 2024


On Sat, Apr 13, 2024 at 4:29 AM Yipeng Zou <zouyipeng at huawei.com> wrote:

> There is a build error has been founded with build in clang-15.0.4:
>
> ./arch/arm/include/asm/memory.h:358:12: error: result of comparison "phys addr_t’ (aka 'unsigned int’) > 4294967295 is always false [-Werror, -Wtautological-type-limit-compare]
>                              if (addr > (u32)~0)
>                                  ~~~~ ^ ~~~~~~~
>
> It will be always goes fail without CONFIG_PHYS_ADDR_T_64BIT.
>
> Directly silence it by Use CONFIG_PHYS_ADDR_T_64BIT.
>
> Fixes: 981b6714dbd2 ("ARM: provide improved virt_to_idmap() functionality")
> Signed-off-by: Yipeng Zou <zouyipeng at huawei.com>
> Reviewed-by: Nathan Chancellor <nathan at kernel.org>

Excellent, thanks!
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Please put this patch into Russell's patch tracker.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list