efi: ARM: avoid warning about phys_addr_t cast
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Apr 2016 08:34:19 +0000 (10:34 +0200)
committerWill Deacon <will.deacon@arm.com>
Tue, 19 Apr 2016 13:46:50 +0000 (14:46 +0100)
memblock_remove() takes a phys_addr_t, which may be narrower than 64 bits,
causing a harmless warning:

drivers/firmware/efi/arm-init.c: In function 'reserve_regions':
include/linux/kernel.h:29:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 #define ULLONG_MAX (~0ULL)
                    ^
drivers/firmware/efi/arm-init.c:152:21: note: in expansion of macro 'ULLONG_MAX'
  memblock_remove(0, ULLONG_MAX);

This adds an explicit typecast to avoid the warning

Fixes: 500899c2cc3e ("efi: ARM/arm64: ignore DT memory nodes instead of removing them")
Acked-by Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/firmware/efi/arm-init.c

index 5d6945b761dcf2727c673d09f6fcd3172bef22e7..ca708fb18c1dfc859487a9f19c4e7352e8b726ac 100644 (file)
@@ -149,7 +149,7 @@ static __init void reserve_regions(void)
         * uses its own memory map instead.
         */
        memblock_dump_all();
-       memblock_remove(0, ULLONG_MAX);
+       memblock_remove(0, (phys_addr_t)ULLONG_MAX);
 
        for_each_efi_memory_desc(&memmap, md) {
                paddr = md->phys_addr;