summaryrefslogtreecommitdiffstats
path: root/mm/madvise.c
diff options
context:
space:
mode:
authorWei Yang <richardw.yang@linux.intel.com>2019-12-01 02:57:46 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2019-12-01 21:59:09 +0100
commitdf6c6500b4416baead2a1e17d9a80b675775c1df (patch)
treeaa11812717961060c09aa1fc1988f21a29b86e97 /mm/madvise.c
parentmm/madvise.c: replace with page_size() in madvise_inject_error() (diff)
downloadlinux-df6c6500b4416baead2a1e17d9a80b675775c1df.tar.xz
linux-df6c6500b4416baead2a1e17d9a80b675775c1df.zip
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 <richardw.yang@linux.intel.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/madvise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index e808dbeb27f3..bcdb6a042787 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)