From: Alexander Kuleshov Date: Fri, 6 Nov 2015 02:46:38 +0000 (-0800) Subject: mm/mincore: use offset_in_page macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e7bbdd071314b52507e6c615e2cec90d46f82c57;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm/mincore: use offset_in_page macro linux/mm.h provides offset_in_page() macro. Let's use already predefined macro instead of (addr & ~PAGE_MASK). Signed-off-by: Alexander Kuleshov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mincore.c b/mm/mincore.c index be25efde64a4..14bb9fb37f0c 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -234,7 +234,7 @@ SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, /* This also avoids any overflows on PAGE_CACHE_ALIGN */ pages = len >> PAGE_SHIFT; - pages += (len & ~PAGE_MASK) != 0; + pages += (offset_in_page(len)) != 0; if (!access_ok(VERIFY_WRITE, vec, pages)) return -EFAULT;