summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorze zuo <zuoze1@huawei.com>2022-09-13 04:55:05 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-10-04 00:03:15 +0300
commitaaa31e058dd82453c89302c9331945894ff555a6 (patch)
treefcd52cb5dc3e34c5203b28c03a22b400cee542d0 /mm
parentd452289fcd68f13f4067f0ddd78a5d948cb7d9ea (diff)
downloadlinux-aaa31e058dd82453c89302c9331945894ff555a6.tar.xz
mm/mempolicy: use PAGE_ALIGN instead of open-coding it
Replace the simple calculation with PAGE_ALIGN. Link: https://lkml.kernel.org/r/20220913015505.1998958-1-zuoze1@huawei.com Signed-off-by: ze zuo <zuoze1@huawei.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 143e2eaaa6ec..a937eaec5b68 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1270,7 +1270,7 @@ static long do_mbind(unsigned long start, unsigned long len,
if (mode == MPOL_DEFAULT)
flags &= ~MPOL_MF_STRICT;
- len = (len + PAGE_SIZE - 1) & PAGE_MASK;
+ len = PAGE_ALIGN(len);
end = start + len;
if (end < start)
@@ -1507,7 +1507,7 @@ SYSCALL_DEFINE4(set_mempolicy_home_node, unsigned long, start, unsigned long, le
if (home_node >= MAX_NUMNODES || !node_online(home_node))
return -EINVAL;
- len = (len + PAGE_SIZE - 1) & PAGE_MASK;
+ len = PAGE_ALIGN(len);
end = start + len;
if (end < start)