]> Pileus Git - ~andy/linux/commitdiff
ARM: fix type of PHYS_PFN_OFFSET to unsigned long
authorCyril Chemparathy <cyril@ti.com>
Wed, 12 Sep 2012 14:19:05 +0000 (10:19 -0400)
committerWill Deacon <will.deacon@arm.com>
Thu, 30 May 2013 15:02:22 +0000 (16:02 +0100)
On LPAE machines, PHYS_OFFSET evaluates to a phys_addr_t and this type is
inherited by the PHYS_PFN_OFFSET definition as well.  Consequently, the kernel
build emits warnings of the form:

init/main.c: In function 'start_kernel':
init/main.c:588:7: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'phys_addr_t' [-Wformat]

This patch fixes this warning by pinning down the PFN type to unsigned long.

Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Subash Patel <subash.rp@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/memory.h

index e506088a767808aa81773a08724a17208310d779..584786f740f938a67a1ce74c1d6062c32abb810a 100644 (file)
@@ -223,7 +223,7 @@ static inline unsigned long __phys_to_virt(unsigned long x)
  * direct-mapped view.  We assume this is the first page
  * of RAM in the mem_map as well.
  */
-#define PHYS_PFN_OFFSET        (PHYS_OFFSET >> PAGE_SHIFT)
+#define PHYS_PFN_OFFSET        ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
 
 /*
  * These are *only* valid on the kernel direct mapped RAM memory.