Commit 11e02d37 authored by Ohhoon Kwon's avatar Ohhoon Kwon Committed by Linus Torvalds

mm: sparse: remove __section_nr() function

As the last users of __section_nr() are gone, let's remove unused function
__section_nr().

Link: https://lkml.kernel.org/r/20210707150212.855-4-ohoono.kwon@samsung.comSigned-off-by: default avatarOhhoon Kwon <ohoono.kwon@samsung.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fc1f5e98
...@@ -1342,7 +1342,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr) ...@@ -1342,7 +1342,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
return NULL; return NULL;
return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
} }
extern unsigned long __section_nr(struct mem_section *ms);
extern size_t mem_section_usage_size(void); extern size_t mem_section_usage_size(void);
/* /*
......
...@@ -109,32 +109,6 @@ static inline int sparse_index_init(unsigned long section_nr, int nid) ...@@ -109,32 +109,6 @@ static inline int sparse_index_init(unsigned long section_nr, int nid)
} }
#endif #endif
#ifdef CONFIG_SPARSEMEM_EXTREME
unsigned long __section_nr(struct mem_section *ms)
{
unsigned long root_nr;
struct mem_section *root = NULL;
for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) {
root = __nr_to_section(root_nr * SECTIONS_PER_ROOT);
if (!root)
continue;
if ((ms >= root) && (ms < (root + SECTIONS_PER_ROOT)))
break;
}
VM_BUG_ON(!root);
return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
}
#else
unsigned long __section_nr(struct mem_section *ms)
{
return (unsigned long)(ms - mem_section[0]);
}
#endif
/* /*
* During early boot, before section_mem_map is used for an actual * During early boot, before section_mem_map is used for an actual
* mem_map, we use section_mem_map to store the section's NUMA * mem_map, we use section_mem_map to store the section's NUMA
......
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