[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210705085538.14557-4-ohoono.kwon@samsung.com>
Date: Mon, 5 Jul 2021 17:55:38 +0900
From: Ohhoon Kwon <ohoono.kwon@...sung.com>
To: david@...hat.com, ohoono.kwon@...sung.com,
akpm@...ux-foundation.org, mhocko@...e.com
Cc: bhe@...hat.com, rppt@...ux.ibm.com, ohkwon1043@...il.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/3] mm: sparse: remove __section_nr() function
As the last users of __section_nr() are gone, let's remove unused
function __section_nr().
Signed-off-by: Ohhoon Kwon <ohoono.kwon@...sung.com>
Acked-by: Michal Hocko <mhocko@...e.com>
Acked-by: Mike Rapoport <rppt@...ux.ibm.com>
Reviewed-by: David Hildenbrand <david@...hat.com>
---
include/linux/mmzone.h | 1 -
mm/sparse.c | 26 --------------------------
2 files changed, 27 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index fcb535560028..8827f4d081d4 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1342,7 +1342,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
return NULL;
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);
/*
diff --git a/mm/sparse.c b/mm/sparse.c
index b4fae2fc6276..c14d2b37fd16 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -109,32 +109,6 @@ static inline int sparse_index_init(unsigned long section_nr, int nid)
}
#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
* mem_map, we use section_mem_map to store the section's NUMA
--
2.17.1
Powered by blists - more mailing lists