ARM: keystone: fix integer overflow warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 23 Mar 2021 13:18:05 +0000 (14:18 +0100)
committerArnd Bergmann <arnd@arndb.de>
Thu, 1 Apr 2021 14:32:37 +0000 (16:32 +0200)
commit844b85dda2f569943e1e018fdd63b6f7d1d6f08e
tree8a3f1f360b146513e3bd352909edca06b36cd654
parent89e21e1ad92373b7306b9b8494d45781598ce72f
ARM: keystone: fix integer overflow warning

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 <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Link: https://lore.kernel.org/r/20210323131814.2751750-1-arnd@kernel.org'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-keystone/keystone.c