aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index c3a8141ac788..3a330d7cae69 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1483,7 +1483,7 @@ bool is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)
1483} 1483}
1484 1484
1485/* 1485/*
1486 * Confirm all pages in a range [start, end) is belongs to the same zone. 1486 * Confirm all pages in a range [start, end) belong to the same zone.
1487 */ 1487 */
1488int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn) 1488int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
1489{ 1489{
@@ -1491,9 +1491,9 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
1491 struct zone *zone = NULL; 1491 struct zone *zone = NULL;
1492 struct page *page; 1492 struct page *page;
1493 int i; 1493 int i;
1494 for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn); 1494 for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn + 1);
1495 pfn < end_pfn; 1495 pfn < end_pfn;
1496 pfn = sec_end_pfn + 1, sec_end_pfn += PAGES_PER_SECTION) { 1496 pfn = sec_end_pfn, sec_end_pfn += PAGES_PER_SECTION) {
1497 /* Make sure the memory section is present first */ 1497 /* Make sure the memory section is present first */
1498 if (!present_section_nr(pfn_to_section_nr(pfn))) 1498 if (!present_section_nr(pfn_to_section_nr(pfn)))
1499 continue; 1499 continue;
@@ -1512,7 +1512,11 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
1512 zone = page_zone(page); 1512 zone = page_zone(page);
1513 } 1513 }
1514 } 1514 }
1515 return 1; 1515
1516 if (zone)
1517 return 1;
1518 else
1519 return 0;
1516} 1520}
1517 1521
1518/* 1522/*