2021-03-23 17:58:51

by Santosh Shilimkar

[permalink] [raw]
Subject: Re: [PATCH] ARM: keystone: fix integer overflow warning



> On Mar 23, 2021, at 6:18 AM, Arnd Bergmann <[email protected]> wrote:
>
> From: Arnd Bergmann <[email protected]>
>
> clang warns about an impossible condition when building with 32-bit
> phys_addr_t:
>
> arch/arm/mach-keystone/keystone.c:79:16: error: result of comparison of constant 51539607551 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
> mem_end > KEYSTONE_HIGH_PHYS_END) {
> ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
> arch/arm/mach-keystone/keystone.c:78:16: error: result of comparison of constant 34359738368 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare]
> if (mem_start < KEYSTONE_HIGH_PHYS_START ||
> ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
>
> Change the temporary variable to a fixed-size u64 to avoid the warning.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> —

Looks fine to me.

Acked-by: Santosh Shilimkar <[email protected]>