diff options
author | Stefan Agner <stefan@agner.ch> | 2018-04-05 19:25:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-06 00:36:27 -0400 |
commit | 644d87dccdc69cf79834a72ed0c889580d6af32a (patch) | |
tree | f5ecd90a78edc8c8d62210bd5a14a9bab16eaa04 | |
parent | 514c60324960137e74457fdc233a339b985fa8a8 (diff) |
mm/memblock.c: cast constant ULLONG_MAX to phys_addr_t
This fixes a warning shown when phys_addr_t is 32-bit int when compiling
with clang:
mm/memblock.c:927:15: warning: implicit conversion from 'unsigned long long'
to 'phys_addr_t' (aka 'unsigned int') changes value from
18446744073709551615 to 4294967295 [-Wconstant-conversion]
r->base : ULLONG_MAX;
^~~~~~~~~~
./include/linux/kernel.h:30:21: note: expanded from macro 'ULLONG_MAX'
#define ULLONG_MAX (~0ULL)
^~~~~
Link: http://lkml.kernel.org/r/20180319005645.29051-1-stefan@agner.ch
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/memblock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index ecc6cb58cd33..9b04568ad42a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -925,7 +925,7 @@ void __init_memblock __next_mem_range(u64 *idx, int nid, ulong flags, | |||
925 | r = &type_b->regions[idx_b]; | 925 | r = &type_b->regions[idx_b]; |
926 | r_start = idx_b ? r[-1].base + r[-1].size : 0; | 926 | r_start = idx_b ? r[-1].base + r[-1].size : 0; |
927 | r_end = idx_b < type_b->cnt ? | 927 | r_end = idx_b < type_b->cnt ? |
928 | r->base : ULLONG_MAX; | 928 | r->base : (phys_addr_t)ULLONG_MAX; |
929 | 929 | ||
930 | /* | 930 | /* |
931 | * if idx_b advanced past idx_a, | 931 | * if idx_b advanced past idx_a, |
@@ -1041,7 +1041,7 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags, | |||
1041 | r = &type_b->regions[idx_b]; | 1041 | r = &type_b->regions[idx_b]; |
1042 | r_start = idx_b ? r[-1].base + r[-1].size : 0; | 1042 | r_start = idx_b ? r[-1].base + r[-1].size : 0; |
1043 | r_end = idx_b < type_b->cnt ? | 1043 | r_end = idx_b < type_b->cnt ? |
1044 | r->base : ULLONG_MAX; | 1044 | r->base : (phys_addr_t)ULLONG_MAX; |
1045 | /* | 1045 | /* |
1046 | * if idx_b advanced past idx_a, | 1046 | * if idx_b advanced past idx_a, |
1047 | * break out to advance idx_a | 1047 | * break out to advance idx_a |