mm: page_alloc: Avoid defining unused function
Subsystems (2)
PATCH 1/1 mm: page_alloc: Avoid defining unused function
In some configurations I gotmm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function] Becuase the only user is guarged with a certain ifdeffery,
do the same for add_to_free_list().
--- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+)
mm/page_alloc.c +2 -0
@@ -653,6 +653,7 @@ static inline void __add_to_free_list(struct page *page, struct zone *zone, area->nr_free++; } +#ifdef CONFIG_MEMORY_FAILURE static inline void add_to_free_list (struct page *page,struct zone *zone,unsigned int order,int migratetype,bool tail)
@@ -660,6 +661,7 @@ static inline void add_to_free_list(struct page *page, struct zone *zone,__add_to_free_list (page, zone, order, migratetype, tail); account_freepages(zone, 1 << order, migratetype); } +#endif /* * Used for pages which are on another list. Move the pages to the tail
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Quoted 4 lines · Andy Shevchenko
In some configurations I got
mm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function] Becuase the only user is guarged with a certain ifdeffery,
do the same foradd_to_free_list().
Why not relocate it within the existing CONFIG_MEMORY_FAILURE block?
Quoted 30 lines
Signed-off-by Andy Shevchenko <[email protected]>--- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+)mm/page_alloc.c +2
-0@@ -653,6 +653,7 @@ static inline void __add_to_free_list(struct page *page, struct zone *zone, area->nr_free++; } +#ifdef CONFIG_MEMORY_FAILURE static inline void add_to_free_list (struct page *page,struct zone *zone,unsigned int order,int migratetype,bool tail)@@ -660,6 +661,7 @@ static inline void add_to_free_list(struct page *page, struct zone *zone,__add_to_free_list (page, zone, order, migratetype, tail); account_freepages(zone, 1 << order, migratetype); } +#endif /* * Used for pages which are on another list. Move the pages to the tail Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Quoted 7 lines · Liam R. Howlett
Quoted 4 lines · Andy Shevchenko
In some configurations I got
mm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function] Becuase the only user is guarged with a certain ifdeffery,
do the same foradd_to_free_list().Why not relocate it within the existing
CONFIG_MEMORY_FAILUREblock?
No objections, I'm not familiar with the idea behind this helper.
Signature · 2 lines
With Best Regards, Andy Shevchenko