Move init_cma_pageblock() from mm_init.c into cma.c so it lives alongside the CMA code that uses it. No functional change intended. Signed-off-by: Muchun Song --- mm/cma.c | 8 ++++++++ mm/mm_init.c | 9 --------- mm/mm_init.h | 8 -------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/mm/cma.c b/mm/cma.c index 3e4366213b49..0c97aadcfea4 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "internal.h" #include "cma.h" @@ -149,6 +150,13 @@ bool cma_validate_zones(struct cma *cma) return true; } +static void __init init_cma_pageblock(struct page *page) +{ + init_pageblock_migratetype(page, MIGRATE_CMA, false); + adjust_managed_page_count(page, pageblock_nr_pages); + page_zone(page)->cma_pages += pageblock_nr_pages; +} + static void __init cma_activate_area(struct cma *cma) { unsigned long pfn, end_pfn, early_pfn[CMA_MAX_RANGES]; diff --git a/mm/mm_init.c b/mm/mm_init.c index a427477483d0..e0686b87fdb1 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2202,15 +2202,6 @@ void __init init_cma_reserved_pageblock(struct page *page) adjust_managed_page_count(page, pageblock_nr_pages); page_zone(page)->cma_pages += pageblock_nr_pages; } -/* - * Similar to above, but only set the migrate type and stats. - */ -void __init init_cma_pageblock(struct page *page) -{ - init_pageblock_migratetype(page, MIGRATE_CMA, false); - adjust_managed_page_count(page, pageblock_nr_pages); - page_zone(page)->cma_pages += pageblock_nr_pages; -} #endif /* diff --git a/mm/mm_init.h b/mm/mm_init.h index c03413a090eb..9ee9bcb8e672 100644 --- a/mm/mm_init.h +++ b/mm/mm_init.h @@ -40,14 +40,6 @@ struct zone *pfn_to_zone(unsigned long pfn, int nid); void init_cma_reserved_pageblock(struct page *page); #endif -#ifdef CONFIG_CMA -void init_cma_pageblock(struct page *page); -#else -static inline void init_cma_pageblock(struct page *page) -{ -} -#endif - /* Memory initialisation debug and verification */ #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT DECLARE_STATIC_KEY_TRUE(deferred_pages); -- 2.54.0