* [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function
@ 2024-04-23 15:06 Andy Shevchenko
2024-04-23 15:55 ` Liam R. Howlett
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2024-04-23 15:06 UTC (permalink / raw
To: Andrew Morton, linux-mm, linux-kernel; +Cc: 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 for add_to_free_list().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
mm/page_alloc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 33d4a1be927b..0fb796b700a4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function
2024-04-23 15:06 [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function Andy Shevchenko
@ 2024-04-23 15:55 ` Liam R. Howlett
2024-04-23 16:06 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Liam R. Howlett @ 2024-04-23 15:55 UTC (permalink / raw
To: Andy Shevchenko; +Cc: Andrew Morton, linux-mm, linux-kernel
* Andy Shevchenko <andriy.shevchenko@linux.intel.com> [240423 11:06]:
> 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 for add_to_free_list().
Why not relocate it within the existing CONFIG_MEMORY_FAILURE block?
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> mm/page_alloc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 33d4a1be927b..0fb796b700a4 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -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
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function
2024-04-23 15:55 ` Liam R. Howlett
@ 2024-04-23 16:06 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2024-04-23 16:06 UTC (permalink / raw
To: Liam R. Howlett, Andrew Morton, linux-mm, linux-kernel
On Tue, Apr 23, 2024 at 11:55:49AM -0400, Liam R. Howlett wrote:
> * Andy Shevchenko <andriy.shevchenko@linux.intel.com> [240423 11:06]:
> > 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 for add_to_free_list().
> Why not relocate it within the existing CONFIG_MEMORY_FAILURE block?
No objections, I'm not familiar with the idea behind this helper.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-23 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 15:06 [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function Andy Shevchenko
2024-04-23 15:55 ` Liam R. Howlett
2024-04-23 16:06 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).