mm/page_isolation: do some cleanup in "undo_isolate_page_range"
authorWang Xiaoqiang <wangxq10@lzu.edu.cn>
Sat, 16 Jan 2016 00:57:13 +0000 (16:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Jan 2016 01:56:32 +0000 (17:56 -0800)
Use "IS_ALIGNED" to judge the alignment, rather than directly judging.

Signed-off-by: Wang Xiaoqiang <wang_xiaoq@126.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_isolation.c

index 5e139fec6c6cc95a68c01d0841a5d41b05a20120..92c4c36501e7c55dc50b9ae330299c978c329d0a 100644 (file)
@@ -196,8 +196,10 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
 {
        unsigned long pfn;
        struct page *page;
-       BUG_ON((start_pfn) & (pageblock_nr_pages - 1));
-       BUG_ON((end_pfn) & (pageblock_nr_pages - 1));
+
+       BUG_ON(!IS_ALIGNED(start_pfn, pageblock_nr_pages));
+       BUG_ON(!IS_ALIGNED(end_pfn, pageblock_nr_pages));
+
        for (pfn = start_pfn;
             pfn < end_pfn;
             pfn += pageblock_nr_pages) {