Commit 673d40c8 authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds

mm: memory_hotplug: cleanup after removal of pfn_valid_within()

When test_pages_in_a_zone() used pfn_valid_within() is has some logic
surrounding pfn_valid_within() checks.

Since pfn_valid_within() is gone, this logic can be removed.

Link: https://lkml.kernel.org/r/20210713080035.7464-3-rppt@kernel.orgSigned-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 859a85dd
...@@ -1298,7 +1298,7 @@ struct zone *test_pages_in_a_zone(unsigned long start_pfn, ...@@ -1298,7 +1298,7 @@ struct zone *test_pages_in_a_zone(unsigned long start_pfn,
unsigned long pfn, sec_end_pfn; unsigned long pfn, sec_end_pfn;
struct zone *zone = NULL; struct zone *zone = NULL;
struct page *page; struct page *page;
int i;
for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn + 1); for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn + 1);
pfn < end_pfn; pfn < end_pfn;
pfn = sec_end_pfn, sec_end_pfn += PAGES_PER_SECTION) { pfn = sec_end_pfn, sec_end_pfn += PAGES_PER_SECTION) {
...@@ -1307,13 +1307,10 @@ struct zone *test_pages_in_a_zone(unsigned long start_pfn, ...@@ -1307,13 +1307,10 @@ struct zone *test_pages_in_a_zone(unsigned long start_pfn,
continue; continue;
for (; pfn < sec_end_pfn && pfn < end_pfn; for (; pfn < sec_end_pfn && pfn < end_pfn;
pfn += MAX_ORDER_NR_PAGES) { pfn += MAX_ORDER_NR_PAGES) {
i = 0;
if (i == MAX_ORDER_NR_PAGES || pfn + i >= end_pfn)
continue;
/* Check if we got outside of the zone */ /* Check if we got outside of the zone */
if (zone && !zone_spans_pfn(zone, pfn + i)) if (zone && !zone_spans_pfn(zone, pfn))
return NULL; return NULL;
page = pfn_to_page(pfn + i); page = pfn_to_page(pfn);
if (zone && page_zone(page) != zone) if (zone && page_zone(page) != zone)
return NULL; return NULL;
zone = page_zone(page); zone = page_zone(page);
......
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