lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 May 2017 14:00:36 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Matthias Kaehlcke <mka@...omium.org>
Subject: [PATCH 3/3] mm/slub: Put tid_to_cpu() and tid_to_event() inside #ifdef block

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@...omium.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ