linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub: fix -Wunused-function compiler warnings
@ 2019-09-17 20:30 Qian Cai
  2019-09-17 21:23 ` David Rientjes
  0 siblings, 1 reply; 4+ messages in thread
From: Qian Cai @ 2019-09-17 20:30 UTC (permalink / raw)
  To: akpm; +Cc: rientjes, cl, penberg, linux-mm, linux-kernel, Qian Cai

tid_to_cpu() and tid_to_event() are only used in note_cmpxchg_failure()
when SLUB_DEBUG_CMPXCHG=y, so when SLUB_DEBUG_CMPXCHG=n by default,
Clang will complain that those unused functions.

Signed-off-by: Qian Cai <cai@lca.pw>
---
 mm/slub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 8834563cdb4b..49739f005b4f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2004,6 +2004,7 @@ static inline unsigned long next_tid(unsigned long tid)
 	return tid + TID_STEP;
 }
 
+#ifdef SLUB_DEBUG_CMPXCHG
 static inline unsigned int tid_to_cpu(unsigned long tid)
 {
 	return tid % TID_STEP;
@@ -2013,6 +2014,7 @@ static inline unsigned long tid_to_event(unsigned long tid)
 {
 	return tid / TID_STEP;
 }
+#endif
 
 static inline unsigned int init_tid(int cpu)
 {
-- 
1.8.3.1


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

* Re: [PATCH] mm/slub: fix -Wunused-function compiler warnings
  2019-09-17 20:30 [PATCH] mm/slub: fix -Wunused-function compiler warnings Qian Cai
@ 2019-09-17 21:23 ` David Rientjes
  2019-09-17 22:35   ` Christoph Lameter
  2019-09-17 23:37   ` Christoph Lameter
  0 siblings, 2 replies; 4+ messages in thread
From: David Rientjes @ 2019-09-17 21:23 UTC (permalink / raw)
  To: Qian Cai; +Cc: akpm, cl, penberg, linux-mm, linux-kernel

On Tue, 17 Sep 2019, Qian Cai wrote:

> tid_to_cpu() and tid_to_event() are only used in note_cmpxchg_failure()
> when SLUB_DEBUG_CMPXCHG=y, so when SLUB_DEBUG_CMPXCHG=n by default,
> Clang will complain that those unused functions.
> 
> Signed-off-by: Qian Cai <cai@lca.pw>

Acked-by: David Rientjes <rientjes@google.com>

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

* Re: [PATCH] mm/slub: fix -Wunused-function compiler warnings
  2019-09-17 21:23 ` David Rientjes
@ 2019-09-17 22:35   ` Christoph Lameter
  2019-09-17 23:37   ` Christoph Lameter
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Lameter @ 2019-09-17 22:35 UTC (permalink / raw)
  To: David Rientjes; +Cc: Qian Cai, akpm, penberg, linux-mm, linux-kernel

On Tue, 17 Sep 2019, David Rientjes wrote:

> On Tue, 17 Sep 2019, Qian Cai wrote:
>
> > tid_to_cpu() and tid_to_event() are only used in note_cmpxchg_failure()
> > when SLUB_DEBUG_CMPXCHG=y, so when SLUB_DEBUG_CMPXCHG=n by default,
> > Clang will complain that those unused functions.
> >
> > Signed-off-by: Qian Cai <cai@lca.pw>
>
> Acked-by: David Rientjes <rientjes@google.com>

Ditto


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

* Re: [PATCH] mm/slub: fix -Wunused-function compiler warnings
  2019-09-17 21:23 ` David Rientjes
  2019-09-17 22:35   ` Christoph Lameter
@ 2019-09-17 23:37   ` Christoph Lameter
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Lameter @ 2019-09-17 23:37 UTC (permalink / raw)
  To: David Rientjes; +Cc: Qian Cai, akpm, penberg, linux-mm, linux-kernel

On Tue, 17 Sep 2019, David Rientjes wrote:

> Acked-by: David Rientjes <rientjes@google.com>

Ditto


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

end of thread, other threads:[~2019-09-17 23:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 20:30 [PATCH] mm/slub: fix -Wunused-function compiler warnings Qian Cai
2019-09-17 21:23 ` David Rientjes
2019-09-17 22:35   ` Christoph Lameter
2019-09-17 23:37   ` Christoph Lameter

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).