summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2015-10-08 13:29:28 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2015-10-09 08:02:25 +1100
commitf78f7ed72632a0794161f290b89e2cd752f55202 (patch)
tree0d6fbd18c2a7f11d5112c3b78aeb68ff2abcd683 /arch/powerpc/boot
parent1b70386c99e997b359735c753ca1a27c6cf87847 (diff)
downloadop-kernel-dev-f78f7ed72632a0794161f290b89e2cd752f55202.zip
op-kernel-dev-f78f7ed72632a0794161f290b89e2cd752f55202.tar.gz
powerpc: Fix _ALIGN_* errors due to type difference.
This avoid errors like unsigned int usize = 1 << 30; int size = 1 << 30; unsigned long addr = 64UL << 30 ; value = _ALIGN_DOWN(addr, usize); -> 0 value = _ALIGN_DOWN(addr, size); -> 0x1000000000 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/page.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/boot/page.h b/arch/powerpc/boot/page.h
index 14eca30f..87c42d7d 100644
--- a/arch/powerpc/boot/page.h
+++ b/arch/powerpc/boot/page.h
@@ -22,8 +22,8 @@
#define PAGE_MASK (~(PAGE_SIZE-1))
/* align addr on a size boundary - adjust address up/down if needed */
-#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
-#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
+#define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((typeof(addr))(size)-1)))
+#define _ALIGN_DOWN(addr, size) ((addr)&(~((typeof(addr))(size)-1)))
/* align addr on a size boundary - adjust address up if needed */
#define _ALIGN(addr,size) _ALIGN_UP(addr,size)
OpenPOWER on IntegriCloud