Commit 1bb36fbd authored by Daniel Kiper's avatar Daniel Kiper Committed by Linus Torvalds

mm/page_cgroup.c: simplify code by using SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN() macros

Commit a539f353 ("mm: add SECTION_ALIGN_UP() and
SECTION_ALIGN_DOWN() macro") introduced the SECTION_ALIGN_UP() and
SECTION_ALIGN_DOWN() macros.  Use those macros to increase code
readability.
Signed-off-by: default avatarDaniel Kiper <dkiper@net-space.pl>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 00a66d29
...@@ -225,8 +225,8 @@ int __meminit online_page_cgroup(unsigned long start_pfn, ...@@ -225,8 +225,8 @@ int __meminit online_page_cgroup(unsigned long start_pfn,
unsigned long start, end, pfn; unsigned long start, end, pfn;
int fail = 0; int fail = 0;
start = start_pfn & ~(PAGES_PER_SECTION - 1); start = SECTION_ALIGN_DOWN(start_pfn);
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); end = SECTION_ALIGN_UP(start_pfn + nr_pages);
if (nid == -1) { if (nid == -1) {
/* /*
...@@ -258,8 +258,8 @@ int __meminit offline_page_cgroup(unsigned long start_pfn, ...@@ -258,8 +258,8 @@ int __meminit offline_page_cgroup(unsigned long start_pfn,
{ {
unsigned long start, end, pfn; unsigned long start, end, pfn;
start = start_pfn & ~(PAGES_PER_SECTION - 1); start = SECTION_ALIGN_DOWN(start_pfn);
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); end = SECTION_ALIGN_UP(start_pfn + nr_pages);
for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION)
__free_page_cgroup(pfn); __free_page_cgroup(pfn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment