All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Bixuan Cui <cuibixuan@huawei.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <linux-next@vger.kernel.org>,
	<john.wanghui@huawei.com>, Roman Gushchin <guro@fb.com>
Subject: Re: [PATCH] mm/percpu: mark pcpu_chunk_type() as __maybe_unused
Date: Tue, 14 Jul 2020 22:53:11 +1000	[thread overview]
Message-ID: <20200714225311.7aeffffd@canb.auug.org.au> (raw)
In-Reply-To: <20200714134101.80534-1-cuibixuan@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

Hi Bixuan,

On Tue, 14 Jul 2020 13:41:01 +0000 Bixuan Cui <cuibixuan@huawei.com> wrote:
>
> Gcc report the following warning without CONFIG_MEMCG_KMEM:
> 
> mm/percpu-internal.h:145:29: warning: ‘pcpu_chunk_type’ defined
> but not used [-Wunused-function]
>  static enum pcpu_chunk_type pcpu_chunk_type(struct pcpu_chunk *chunk)
>                              ^~~~~~~~~~~~~~~
> 
> Mark pcpu_chunk_type() as __maybe_unused to make it clear.

Given that it is in a header file, it should probably just be "static
inline" (which will also suppress the warning).  As should
pcpu_is_memcg_chunk() and pcpu_chunk_list().  Also, without them being
inline, there will be a new copy for each file that
mm/percpu-internal.h is included in.

And that should be considered a fix for "mm: memcg/percpu: account
percpu memory to memory cgroups".

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-07-14 12:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 13:41 [PATCH] mm/percpu: mark pcpu_chunk_type() as __maybe_unused Bixuan Cui
2020-07-14 12:53 ` Stephen Rothwell [this message]
2020-07-14 13:33   ` Bixuan Cui
2020-07-14 13:34   ` [PATCH v2] mm/percpu: fix 'defined but not used' warning Bixuan Cui
2020-07-14 13:45     ` Bixuan Cui
2020-07-14 13:46   ` Bixuan Cui
2020-07-14 18:41     ` Roman Gushchin
2020-07-15  0:24       ` Bixuan Cui
2020-07-14 20:22     ` Stephen Rothwell
2020-07-15  0:25       ` [PATCH v3] " Bixuan Cui
2020-07-15  1:50         ` Stephen Rothwell
2020-07-15  2:18           ` 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=20200714225311.7aeffffd@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=cuibixuan@huawei.com \
    --cc=guro@fb.com \
    --cc=john.wanghui@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.