Re: [PATCH] mm/sparse: correct init section annotations
Anshuman Khandual <[email protected]> Mon, 3 Aug 2026 11:36:07 +0530
| Newsgroups | org.kvack.linux-mm |
|---|---|
| Message-ID | <xcu5b6z5fxnbwesw5zdljksjozgtb7zdtct5envczyibx4gfbi@lgv6pzrfbk6k> |
On Sat, Aug 01, 2026 at 01:47:55AM +0900, Sang-Heon Jeon wrote: > The !SPARSEMEM_EXTREME stub of sparse_index_init() has no annotation > but the SPARSEMEM_EXTREME variant is __meminit. So mark the stub > __meminit too. > > mminit_validate_memmodel_limits() is only called by memory_present(), > which is __init. So mark it __init. > > sparse_usagebuf and sparse_usagebuf_end are only used by > sparse_init_early_section(), sparse_usage_init() and sparse_usage_fini(), > which are all __init. So mark them __initdata. > > Signed-off-by: Sang-Heon Jeon <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> > --- > mm/sparse.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/mm/sparse.c b/mm/sparse.c > index 704a9dec2b9a..67fa192d4289 100644 > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -104,7 +104,7 @@ int __meminit sparse_index_init(unsigned long section_nr, int nid) > return 0; > } > #else /* !SPARSEMEM_EXTREME */ > -int sparse_index_init(unsigned long section_nr, int nid) > +int __meminit sparse_index_init(unsigned long section_nr, int nid) > { > return 0; > } > @@ -127,7 +127,7 @@ static inline int sparse_early_nid(struct mem_section *section) > } > > /* Validate the physical addressing limitations of the model */ > -static void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn, > +static void __init mminit_validate_memmodel_limits(unsigned long *start_pfn, > unsigned long *end_pfn) > { > unsigned long max_sparsemem_pfn = (DIRECT_MAP_PHYSMEM_END + 1) >> PAGE_SHIFT; > @@ -249,8 +249,8 @@ void __weak __meminit vmemmap_populate_print_last(void) > { > } > > -static void *sparse_usagebuf __meminitdata; > -static void *sparse_usagebuf_end __meminitdata; > +static void *sparse_usagebuf __initdata; > +static void *sparse_usagebuf_end __initdata; > > /* > * Helper function that is used for generic section initialization, and > -- > 2.43.0 > >