All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/percpu: mark pcpu_chunk_type() as __maybe_unused
@ 2020-07-14 13:41 Bixuan Cui
  2020-07-14 12:53 ` Stephen Rothwell
  0 siblings, 1 reply; 12+ messages in thread
From: Bixuan Cui @ 2020-07-14 13:41 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, linux-next, cuibixuan, john.wanghui

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.

Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
---
 mm/percpu-internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/percpu-internal.h b/mm/percpu-internal.h
index 7983455842ff..8a8a230bd957 100644
--- a/mm/percpu-internal.h
+++ b/mm/percpu-internal.h
@@ -129,7 +129,7 @@ static inline int pcpu_chunk_map_bits(struct pcpu_chunk *chunk)
 }

 #ifdef CONFIG_MEMCG_KMEM
-static enum pcpu_chunk_type pcpu_chunk_type(struct pcpu_chunk *chunk)
+static enum pcpu_chunk_type __maybe_unused pcpu_chunk_type(struct pcpu_chunk *chunk)
 {
 	if (chunk->obj_cgroups)
 		return PCPU_CHUNK_MEMCG;
@@ -142,7 +142,7 @@ static bool pcpu_is_memcg_chunk(enum pcpu_chunk_type chunk_type)
 }

 #else
-static enum pcpu_chunk_type pcpu_chunk_type(struct pcpu_chunk *chunk)
+static enum pcpu_chunk_type __maybe_unused pcpu_chunk_type(struct pcpu_chunk *chunk)
 {
 	return PCPU_CHUNK_ROOT;
 }
--
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-15  2:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 13:41 [PATCH] mm/percpu: mark pcpu_chunk_type() as __maybe_unused Bixuan Cui
2020-07-14 12:53 ` Stephen Rothwell
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

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.