From: David Hildenbrand (Arm) Date: Fri, 20 Mar 2026 22:13:46 +0000 (+0100) Subject: mm/sparse: move __section_mark_present() to internal.h X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08e5f77c37206da5a8340afdbf23b61e722c0ed3;p=thirdparty%2Fkernel%2Flinux.git mm/sparse: move __section_mark_present() to internal.h 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) Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Lorenzo Stoakes (Oracle) Cc: Axel Rasmussen Cc: Liam Howlett Cc: Michal Hocko Cc: Oscar Salvador Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- diff --git a/mm/internal.h b/mm/internal.h index e14f585276889..4e753bbf00ae2 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -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 */ diff --git a/mm/sparse.c b/mm/sparse.c index ed5de1a25f044..ecd4c41c0ff01 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -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) {