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


Groups > linux.kernel > #1645949 > unrolled thread

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

Started byMatthias Kaehlcke <mka@chromium.org>
First post2017-05-19 23:10 +0200
Last post2017-05-19 23:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [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

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

FromMatthias Kaehlcke <mka@chromium.org>
Date2017-05-19 23:10 +0200
Subject[PATCH 3/3] mm/slub: Put tid_to_cpu() and tid_to_event() inside #ifdef block
Message-ID<tIXjR-7UF-49@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web