mirror of
https://github.com/t2linux/kernel.git
synced 2026-04-30 13:48:59 -07:00
mm/memory_hotplug: drop valid_start/valid_end from test_pages_in_a_zone()
The callers are only interested in the actual zone, they don't care about boundaries. Return the zone instead to simplify. Link: http://lkml.kernel.org/r/20200110183308.11849-1-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
52fb87c81f
commit
9291799884
@@ -376,7 +376,6 @@ static ssize_t valid_zones_show(struct device *dev,
|
||||
struct memory_block *mem = to_memory_block(dev);
|
||||
unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr);
|
||||
unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
|
||||
unsigned long valid_start_pfn, valid_end_pfn;
|
||||
struct zone *default_zone;
|
||||
int nid;
|
||||
|
||||
@@ -389,11 +388,11 @@ static ssize_t valid_zones_show(struct device *dev,
|
||||
* The block contains more than one zone can not be offlined.
|
||||
* This can happen e.g. for ZONE_DMA and ZONE_DMA32
|
||||
*/
|
||||
if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages,
|
||||
&valid_start_pfn, &valid_end_pfn))
|
||||
default_zone = test_pages_in_a_zone(start_pfn,
|
||||
start_pfn + nr_pages);
|
||||
if (!default_zone)
|
||||
return sprintf(buf, "none\n");
|
||||
start_pfn = valid_start_pfn;
|
||||
strcat(buf, page_zone(pfn_to_page(start_pfn))->name);
|
||||
strcat(buf, default_zone->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user