From: Wei Yang Date: Sun, 1 Dec 2019 01:57:46 +0000 (-0800) Subject: mm/madvise.c: use PAGE_ALIGN[ED] for range checking X-Git-Tag: v5.10.7~3743^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df6c6500b4416baead2a1e17d9a80b675775c1df;p=platform%2Fkernel%2Flinux-rpi.git mm/madvise.c: use PAGE_ALIGN[ED] for range checking Improve readability, no functional change. Link: http://lkml.kernel.org/r/20191118032857.22683-1-richardw.yang@linux.intel.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/madvise.c b/mm/madvise.c index e808dbe..bcdb6a0 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1059,9 +1059,9 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) if (!madvise_behavior_valid(behavior)) return error; - if (start & ~PAGE_MASK) + if (!PAGE_ALIGNED(start)) return error; - len = (len_in + ~PAGE_MASK) & PAGE_MASK; + len = PAGE_ALIGN(len_in); /* Check to see whether len was rounded up from small -ve to zero */ if (len_in && !len)