Skip to content

Commit 1bb36fb

Browse files
dkipertorvalds
authored andcommitted
mm/page_cgroup.c: simplify code by using SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN() macros
Commit a539f35 ("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>
1 parent 00a66d2 commit 1bb36fb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎mm/page_cgroup.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ int __meminit online_page_cgroup(unsigned long start_pfn,
225225
unsigned long start, end, pfn;
226226
int fail = 0;
227227

228-
start = start_pfn & ~(PAGES_PER_SECTION - 1);
229-
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION);
228+
start = SECTION_ALIGN_DOWN(start_pfn);
229+
end = SECTION_ALIGN_UP(start_pfn + nr_pages);
230230

231231
if (nid == -1) {
232232
/*
@@ -258,8 +258,8 @@ int __meminit offline_page_cgroup(unsigned long start_pfn,
258258
{
259259
unsigned long start, end, pfn;
260260

261-
start = start_pfn & ~(PAGES_PER_SECTION - 1);
262-
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION);
261+
start = SECTION_ALIGN_DOWN(start_pfn);
262+
end = SECTION_ALIGN_UP(start_pfn + nr_pages);
263263

264264
for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION)
265265
__free_page_cgroup(pfn);

0 commit comments

Comments
 (0)