From: Matthew Wilcox <willy@infradead.org>
To: Bixuan Cui <cuibixuan@huawei.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] mm/mmap_lock: fix warning when CONFIG_TRACING is not defined
Date: Mon, 31 May 2021 03:02:28 +0100 [thread overview]
Message-ID: <YLRDtBCPAYajOSqa@casper.infradead.org> (raw)
In-Reply-To: <20210531015527.49785-1-cuibixuan@huawei.com>
On Mon, May 31, 2021 at 09:55:27AM +0800, Bixuan Cui wrote:
> Fix the warning: [-Wunused-function]
> mm/mmap_lock.c:157:20: warning: ‘get_mm_memcg_path’ defined but not used
> static const char *get_mm_memcg_path(struct mm_struct *mm)
> ^~~~~~~~~~~~~~~~~
That seems like the wrong way to fix the warning. Why not put it
under an appropriate ifdef?
> Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
> ---
> mm/mmap_lock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c
> index 03ee85c696ef..ec7899b08690 100644
> --- a/mm/mmap_lock.c
> +++ b/mm/mmap_lock.c
> @@ -154,7 +154,7 @@ static inline void put_memcg_path_buf(void)
> * The caller must call put_memcg_path_buf() once the buffer is no longer
> * needed. This must be done while preemption is still disabled.
> */
> -static const char *get_mm_memcg_path(struct mm_struct *mm)
> +static const char __maybe_unused *get_mm_memcg_path(struct mm_struct *mm)
> {
> char *buf = NULL;
> struct mem_cgroup *memcg = get_mem_cgroup_from_mm(mm);
> --
> 2.17.1
>
>
next prev parent reply other threads:[~2021-05-31 2:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 1:55 [PATCH -next] mm/mmap_lock: fix warning when CONFIG_TRACING is not defined Bixuan Cui
2021-05-31 2:02 ` Matthew Wilcox [this message]
2021-05-31 3:34 ` Bixuan Cui
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=YLRDtBCPAYajOSqa@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=cuibixuan@huawei.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;
as well as URLs for NNTP newsgroup(s).