Commit fe91eca6 authored by Dev Jain's avatar Dev Jain Committed by Andrew Morton

mm: sparse: consistently use _nr

Consistently name the return variable with an _nr suffix, whenever calling
pfn_to_section_nr(), to avoid confusion with a (struct mem_section *).

Link: https://lkml.kernel.org/r/20240531124144.240399-1-dev.jain@arm.comSigned-off-by: default avatarDev Jain <dev.jain@arm.com>
Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Acked-by: default avatarOscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7bc131c5
...@@ -192,13 +192,13 @@ static void subsection_mask_set(unsigned long *map, unsigned long pfn, ...@@ -192,13 +192,13 @@ static void subsection_mask_set(unsigned long *map, unsigned long pfn,
void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages)
{ {
int end_sec = pfn_to_section_nr(pfn + nr_pages - 1); int end_sec_nr = pfn_to_section_nr(pfn + nr_pages - 1);
unsigned long nr, start_sec = pfn_to_section_nr(pfn); unsigned long nr, start_sec_nr = pfn_to_section_nr(pfn);
if (!nr_pages) if (!nr_pages)
return; return;
for (nr = start_sec; nr <= end_sec; nr++) { for (nr = start_sec_nr; nr <= end_sec_nr; nr++) {
struct mem_section *ms; struct mem_section *ms;
unsigned long pfns; unsigned long pfns;
...@@ -229,17 +229,17 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en ...@@ -229,17 +229,17 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en
start &= PAGE_SECTION_MASK; start &= PAGE_SECTION_MASK;
mminit_validate_memmodel_limits(&start, &end); mminit_validate_memmodel_limits(&start, &end);
for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
unsigned long section = pfn_to_section_nr(pfn); unsigned long section_nr = pfn_to_section_nr(pfn);
struct mem_section *ms; struct mem_section *ms;
sparse_index_init(section, nid); sparse_index_init(section_nr, nid);
set_section_nid(section, nid); set_section_nid(section_nr, nid);
ms = __nr_to_section(section); ms = __nr_to_section(section_nr);
if (!ms->section_mem_map) { if (!ms->section_mem_map) {
ms->section_mem_map = sparse_encode_early_nid(nid) | ms->section_mem_map = sparse_encode_early_nid(nid) |
SECTION_IS_ONLINE; SECTION_IS_ONLINE;
__section_mark_present(ms, section); __section_mark_present(ms, section_nr);
} }
} }
} }
......
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