summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2026-08-05 10:25:36 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-08-24 18:43:06 -0700
commite73aeb8a411e5327da9c0746b2f93924ab081113 (patch)
treebb9059ddf76cca8de52f334bf981caf9f01acebd /include/linux
parentafff109c2f8b35b88ea783d345c1067a311a57d8 (diff)
mm/sparse: keep mem_section_usage_size() internal
mem_section_usage_size() is only needed by sparsemem implementation code after commit ae751d567baa ("mm/bootmem_info: stop marking mem_section_usage as MIX_SECTION_INFO"), so keeping the declaration in mmzone.h now exposes the helper to all mmzone.h users for no reason. Move the helper to sparse.h so sparse.c and sparse-vmemmap.c can share it through the internal header. While doing so, calculate the allocation size with struct_size_t(), which ties the expression to the pageblock_flags trailing array instead of open-coding the struct header plus bitmap size. Link: https://lore.kernel.org/20260805022536.1206575-1-songmuchun@bytedance.com Signed-off-by: Muchun Song <songmuchun@bytedance.com> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmzone.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 158c1fba2393..94f9c3ff5416 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -2069,7 +2069,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
#endif
return &mem_section[root][nr & SECTION_ROOT_MASK];
}
-extern size_t mem_section_usage_size(void);
/*
* We use the lower bits of the mem_map pointer to store a little bit of