ARM: mvebu: avoid clang -Wtautological-constant warning
PATCH 1/1 ARM: mvebu: avoid clang -Wtautological-constant warning
From: Arnd Bergmann <[email protected]>
Clang warns about the comparison when using a 32-bit phys_addr_t:
drivers/bus/mvebu-mbus.c:621:17: error: result of comparison of constant 4294967296 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (reg_start >= 0x100000000ULL)
Add a cast to shut up the warning.
--- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mvebu-mbus.c +1 -1
@@ -618,7 +618,7 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end)* This part of the memory is above 4 GB, so we don't * care for the MBus bridge hole. */ -if (reg_start >=0x100000000ULL ) +if ((u64 )reg_start >=0x100000000ULL )continue ;/*
Signature · 1 line
2.29.2
Quoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Clang warns about the comparison when using a 32-bit
phys_addr_t:
drivers/bus/mvebu-mbus.c:621:17: error: result of comparison of constant 4294967296 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]if (reg_start >= 0x100000000ULL)Add a cast to shut up the warning.
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 20 lines
--- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/bus/mvebu-mbus.c +1
-1@@ -618,7 +618,7 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end)* This part of the memory is above 4 GB, so we don't * care for the MBus bridge hole. */ -if (reg_start >=0x100000000ULL ) +if ((u64 )reg_start >=0x100000000ULL )continue ;/* Signature · 1 line
2.29.2
Arnd Bergmann
AppliedFrom: Arnd Bergmann <[email protected]>
Quoted 6 lines · Arnd Bergmann
Clang warns about the comparison when using a 32-bit
phys_addr_t:
drivers/bus/mvebu-mbus.c:621:17: error: result of comparison of constant 4294967296 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]if (reg_start >= 0x100000000ULL)Add a cast to shut up the warning.
Applied to arm/fixes.
[1/1] ARM: mvebu: avoid clang -Wtautological-constant warning
commit: da03f523e83350caf2cf12f1169eca129efc445a
Arnd