Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645949

[PATCH 3/3] mm/slub: Put tid_to_cpu() and tid_to_event() inside #ifdef block

From Matthias Kaehlcke <mka@chromium.org>
Newsgroups linux.kernel
Subject [PATCH 3/3] mm/slub: Put tid_to_cpu() and tid_to_event() inside #ifdef block
Date 2017-05-19 23:10 +0200
Message-ID <tIXjR-7UF-49@gated-at.bofh.it> (permalink)
References <tIXjP-7UF-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The functions are only used when certain config options are set. Putting
them inside #ifdef fixes the following warnings when building with clang:

mm/slub.c:1759:28: error: unused function 'tid_to_cpu'
    [-Werror,-Wunused-function]
                           ^
mm/slub.c:1764:29: error: unused function 'tid_to_event'
    [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 mm/slub.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 23a8eb83efff..6df95738420d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1945,15 +1945,19 @@ static inline unsigned long next_tid(unsigned long tid)
 	return tid + TID_STEP;
 }
 
+#ifdef SLUB_DEBUG_CMPXCHG
+#ifdef CONFIG_PREEMPT
 static inline unsigned int tid_to_cpu(unsigned long tid)
 {
 	return tid % TID_STEP;
 }
+#endif
 
 static inline unsigned long tid_to_event(unsigned long tid)
 {
 	return tid / TID_STEP;
 }
+#endif
 
 static inline unsigned int init_tid(int cpu)
 {
-- 
2.13.0.303.g4ebf302169-goog

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3/3] mm/slub: Put tid_to_cpu() and tid_to_event() inside #ifdef block Matthias Kaehlcke <mka@chromium.org> - 2017-05-19 23:10 +0200

csiph-web