Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381377 > unrolled thread

[PATCH] efi: ARM: avoid warning about phys_addr_t cast

Started byArnd Bergmann <arnd@arndb.de>
First post2016-04-18 10:40 +0200
Last post2016-04-19 15:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] efi: ARM: avoid warning about phys_addr_t cast Arnd Bergmann <arnd@arndb.de> - 2016-04-18 10:40 +0200
    Re: [PATCH] efi: ARM: avoid warning about phys_addr_t cast Matt Fleming <matt@codeblueprint.co.uk> - 2016-04-18 23:20 +0200
      Re: [PATCH] efi: ARM: avoid warning about phys_addr_t cast Will Deacon <will.deacon@arm.com> - 2016-04-19 15:50 +0200

#1381377 — [PATCH] efi: ARM: avoid warning about phys_addr_t cast

FromArnd Bergmann <arnd@arndb.de>
Date2016-04-18 10:40 +0200
Subject[PATCH] efi: ARM: avoid warning about phys_addr_t cast
Message-ID<rpcSR-2jV-5@gated-at.bofh.it>
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

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 500899c2cc3e ("efi: ARM/arm64: ignore DT memory nodes instead of removing them")
---
 drivers/firmware/efi/arm-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index 434dd6065935..fac567c3b66a 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -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;
-- 
2.7.0

[toc] | [next] | [standalone]


#1382051

FromMatt Fleming <matt@codeblueprint.co.uk>
Date2016-04-18 23:20 +0200
Message-ID<rpoKm-3Yo-21@gated-at.bofh.it>
In reply to#1381377
On Mon, 18 Apr, at 10:34:19AM, Arnd Bergmann wrote:
> 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
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 500899c2cc3e ("efi: ARM/arm64: ignore DT memory nodes instead of removing them")
> ---
>  drivers/firmware/efi/arm-init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Will, this one is for you.

Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>

[toc] | [prev] | [next] | [standalone]


#1382531

FromWill Deacon <will.deacon@arm.com>
Date2016-04-19 15:50 +0200
Message-ID<rpEcq-7GG-29@gated-at.bofh.it>
In reply to#1382051
On Mon, Apr 18, 2016 at 10:12:33PM +0100, Matt Fleming wrote:
> On Mon, 18 Apr, at 10:34:19AM, Arnd Bergmann wrote:
> > 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
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Fixes: 500899c2cc3e ("efi: ARM/arm64: ignore DT memory nodes instead of removing them")
> > ---
> >  drivers/firmware/efi/arm-init.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Will, this one is for you.
> 
> Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>

Thanks, I'll throw it on the pile.

Will

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web