Re: [PATCH v2] mm/percpu: fix 'defined but not used' warning

From: Stephen Rothwell
Date: Tue Jul 14 2020 - 16:23:05 EST


Hi Bixuan,

Thanks for this.

On Tue, 14 Jul 2020 21:46:18 +0800 Bixuan Cui <cuibixuan@xxxxxxxxxx> 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)
> ^~~~~~~~~~~~~~~
>
> Add 'inline' to pcpu_chunk_type(),pcpu_is_memcg_chunk() and
> pcpu_chunk_list() to clear warning.
>
> Fixes: 26c99879ef01 ("mm: memcg/percpu: account percpu memory to memory cgroups")
> Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>

You really should not add SUB lines for others - in this case a
Suggested-by is more appropriate.

--
Cheers,
Stephen Rothwell

Attachment: pgpXOq20tHWgr.pgp
Description: OpenPGP digital signature