linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] mm: page_alloc: Avoid defining unused function
Date: Tue, 23 Apr 2024 11:55:49 -0400	[thread overview]
Message-ID: <f3qr7e7nmith6i4dbffsxvm63wappv4nl4d7nuto4432mpcec3@t74zh4amndir> (raw)
In-Reply-To: <20240423150622.2526825-1-andriy.shevchenko@linux.intel.com>

* 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
> 
> 


  reply	other threads:[~2024-04-23 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 15:06 Andy Shevchenko
2024-04-23 15:55 ` Liam R. Howlett [this message]
2024-04-23 16:06   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3qr7e7nmith6i4dbffsxvm63wappv4nl4d7nuto4432mpcec3@t74zh4amndir \
    --to=liam.howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox