]> Git Repo - linux.git/commitdiff
mm/memblock.c: cast constant ULLONG_MAX to phys_addr_t
authorStefan Agner <[email protected]>
Thu, 5 Apr 2018 23:25:38 +0000 (16:25 -0700)
committerLinus Torvalds <[email protected]>
Fri, 6 Apr 2018 04:36:27 +0000 (21:36 -0700)
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/[email protected]
Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memblock.c

index ecc6cb58cd33cf4fce84d9920ebc7e8b461f86e4..9b04568ad42a67600af97468dbf51e04e875e473 100644 (file)
@@ -925,7 +925,7 @@ void __init_memblock __next_mem_range(u64 *idx, int nid, ulong flags,
                        r = &type_b->regions[idx_b];
                        r_start = idx_b ? r[-1].base + r[-1].size : 0;
                        r_end = idx_b < type_b->cnt ?
-                               r->base : ULLONG_MAX;
+                               r->base : (phys_addr_t)ULLONG_MAX;
 
                        /*
                         * if idx_b advanced past idx_a,
@@ -1041,7 +1041,7 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags,
                        r = &type_b->regions[idx_b];
                        r_start = idx_b ? r[-1].base + r[-1].size : 0;
                        r_end = idx_b < type_b->cnt ?
-                               r->base : ULLONG_MAX;
+                               r->base : (phys_addr_t)ULLONG_MAX;
                        /*
                         * if idx_b advanced past idx_a,
                         * break out to advance idx_a
This page took 0.062378 seconds and 4 git commands to generate.