summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2015-01-29 11:45:31 +1000
committerDave Airlie <airlied@gmail.com>2015-01-29 11:45:31 +1000
commitb3869b17fd63bacb53ac4db4ff4ba093701e17be (patch)
tree073873d62957033f317bc413d9ea9fd5d5ff5a50 /arch/arm/kernel/setup.c
parent7b83741bf76caad72bc8a701c26dde8d6751ff0f (diff)
parentc59c961ca511dc7ee2f4f7e9c224d16f5c76ca6e (diff)
downloadop-kernel-dev-b3869b17fd63bacb53ac4db4ff4ba093701e17be.zip
op-kernel-dev-b3869b17fd63bacb53ac4db4ff4ba093701e17be.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next
This backmerges drm-fixes into drm-next mainly for the amdkfd stuff, I'm not 100% confident, but it builds and the amdkfd folks can fix anything up. Signed-off-by: Dave Airlie <airlied@redhat.com> Conflicts: drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 715ae19..e55408e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -657,10 +657,13 @@ int __init arm_add_memory(u64 start, u64 size)
/*
* Ensure that start/size are aligned to a page boundary.
- * Size is appropriately rounded down, start is rounded up.
+ * Size is rounded down, start is rounded up.
*/
- size -= start & ~PAGE_MASK;
aligned_start = PAGE_ALIGN(start);
+ if (aligned_start > start + size)
+ size = 0;
+ else
+ size -= aligned_start - start;
#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
if (aligned_start > ULONG_MAX) {
OpenPOWER on IntegriCloud