aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDaniel Kiper <dkiper@net-space.pl>2011-07-25 20:12:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:57:09 -0400
commit1bb36fbd4d58ec3fab4dab5ed39a2af492c263ea (patch)
treeb381b2a4a0d212053516073a8bd21e7b4c59cfad /mm
parent00a66d2974485d7d95d61d5772142b2a2231ed2a (diff)
mm/page_cgroup.c: simplify code by using SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN() macros
Commit a539f3533b78e3 ("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: Daniel Kiper <dkiper@net-space.pl> Acked-by: David Rientjes <rientjes@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_cgroup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 9cb1c44ffc37..39d216d535ea 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -225,8 +225,8 @@ int __meminit online_page_cgroup(unsigned long start_pfn,
225 unsigned long start, end, pfn; 225 unsigned long start, end, pfn;
226 int fail = 0; 226 int fail = 0;
227 227
228 start = start_pfn & ~(PAGES_PER_SECTION - 1); 228 start = SECTION_ALIGN_DOWN(start_pfn);
229 end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); 229 end = SECTION_ALIGN_UP(start_pfn + nr_pages);
230 230
231 if (nid == -1) { 231 if (nid == -1) {
232 /* 232 /*
@@ -258,8 +258,8 @@ int __meminit offline_page_cgroup(unsigned long start_pfn,
258{ 258{
259 unsigned long start, end, pfn; 259 unsigned long start, end, pfn;
260 260
261 start = start_pfn & ~(PAGES_PER_SECTION - 1); 261 start = SECTION_ALIGN_DOWN(start_pfn);
262 end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); 262 end = SECTION_ALIGN_UP(start_pfn + nr_pages);
263 263
264 for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) 264 for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION)
265 __free_page_cgroup(pfn); 265 __free_page_cgroup(pfn);