]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/sparse: move __section_mark_present() to internal.h
authorDavid Hildenbrand (Arm) <david@kernel.org>
Fri, 20 Mar 2026 22:13:46 +0000 (23:13 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:33 +0000 (13:53 -0700)
Let's prepare for moving memory hotplug handling from sparse.c to
sparse-vmemmap.c by moving __section_mark_present() to internal.h.

Link: https://lkml.kernel.org/r/20260320-sparsemem_cleanups-v2-14-096addc8800d@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/internal.h
mm/sparse.c

index e14f58527688918a19746ad23bcd0beee430b1fc..4e753bbf00ae2de0d62fb8fb753e3483e1e4baf0 100644 (file)
@@ -986,6 +986,15 @@ static inline void sparse_init_one_section(struct mem_section *ms,
        ms->section_mem_map |= flags | SECTION_HAS_MEM_MAP;
        ms->usage = usage;
 }
+
+static inline void __section_mark_present(struct mem_section *ms,
+               unsigned long section_nr)
+{
+       if (section_nr > __highest_present_section_nr)
+               __highest_present_section_nr = section_nr;
+
+       ms->section_mem_map |= SECTION_MARKED_PRESENT;
+}
 #else
 static inline void sparse_init(void) {}
 #endif /* CONFIG_SPARSEMEM */
index ed5de1a25f0449b622b7495eed1f4ae51dcd6f55..ecd4c41c0ff016c24b3fa0b01b9af8734937de24 100644 (file)
@@ -161,14 +161,6 @@ static void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn,
  * those loops early.
  */
 unsigned long __highest_present_section_nr;
-static void __section_mark_present(struct mem_section *ms,
-               unsigned long section_nr)
-{
-       if (section_nr > __highest_present_section_nr)
-               __highest_present_section_nr = section_nr;
-
-       ms->section_mem_map |= SECTION_MARKED_PRESENT;
-}
 
 static inline unsigned long first_present_section_nr(void)
 {