aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/page.h
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/include/asm/page.h
parentpowerpc/kexec: Wait 1s for secondaries to enter OPAL (diff)
downloadlinux-dev-f78f7ed72632a0794161f290b89e2cd752f55202.tar.xz
linux-dev-f78f7ed72632a0794161f290b89e2cd752f55202.zip
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/include/asm/page.h')
-rw-r--r--arch/powerpc/include/asm/page.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 168ca67e39b3..73b58ff6c451 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -12,6 +12,7 @@
#ifndef __ASSEMBLY__
#include <linux/types.h>
+#include <linux/kernel.h>
#else
#include <asm/types.h>
#endif
@@ -241,8 +242,8 @@ extern long long virt_phys_offset;
#endif
/* 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) __ALIGN_KERNEL(addr, size)
+#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)