lockdep: silence warnings
Subsystems (4)
PATCH 1/1 lockdep: silence warnings
net/bluetooth/af_bluetooth.c:57: warning: 'bt_key_strings' defined but not used net/bluetooth/af_bluetooth.c:68: warning: 'bt_slock_key_strings' defined but not used
---
include/linux/lockdep.h | 4 ++-- net/core/sock.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
include/linux/lockdep.h +2 -2
@@ -331,10 +331,10 @@ static inline void lockdep_on(void)# define lock_set_subclass (l, s, i) do { } while (0)# define lockdep_init () do { } while (0)# define lockdep_info () do { } while (0) -# define lockdep_init_map (lock, name, key, sub) do { (void)(key); } while (0) +# define lockdep_init_map (lock, name, key, sub) do { (void)(name); (void)(key); } while (0)# define lockdep_set_class (lock, key) do { (void)(key); } while (0)# define lockdep_set_class_and_name (lock, key, name) \ - do { (void)(key); } while (0) + do { (void)(key); (void)(name); } while (0)#define lockdep_set_class_and_subclass (lock, key, sub) \ do { (void)(key); } while (0)#define lockdep_set_subclass (lock, sub) do { } while (0)
net/core/sock.c +0 -2
@@ -136,7 +136,6 @@static struct lock_class_key af_family_keys[AF_MAX ];static struct lock_class_key af_family_slock_keys[AF_MAX ]; -#ifdef CONFIG_DEBUG_LOCK_ALLOC /* * Make lock validator output more readable. (we pre-construct these * strings build-time, so that runtime initialization of socket
@@ -187,7 +186,6 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {"clock-AF_RXRPC" ,"clock-AF_ISDN" ,"clock-AF_PHONET" , "clock-AF_MAX" }; -#endif /* * sk_callback_lock locking rules are per-address-family,
Quoted 4 lines · Alexey Dobriyan
net/bluetooth/af_bluetooth.c:57: warning: 'bt_key_strings' defined but not usednet/bluetooth/af_bluetooth.c:68: warning: 'bt_slock_key_strings' defined but not usedSigned-off-by Alexey Dobriyan <[email protected]>
similar to what i did a month ago:
--------------->
From 15d50b15843ccea15667f0bff5eb54d389a445f9 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Fri, 17 Oct 2008 15:55:07 +0200
Subject: [PATCH] lockdep: include/linux/lockdep.h - fix warning in net/bluetooth/af_bluetooth.c
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
fix this warning:
net/bluetooth/af_bluetooth.c:60: warning: ‘bt_key_strings’ defined but not used net/bluetooth/af_bluetooth.c:71: warning: ‘bt_slock_key_strings’ defined but not used
this is a lockdep macro problem in the !LOCKDEP case.
We cannot convert it to an inline because the macro works on multiple types, but we can mark the parameter used.
[ also clean up a misaligned tab in sock_lock_init_class_and_name() ]
[ also remove #ifdefs from around af_family_clock_key strings - which
were certainly added to get rid of the ugly build warnings. ]
--- include/linux/lockdep.h | 5 +++-- include/net/sock.h | 2 +- net/core/sock.c | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-)
include/linux/lockdep.h +3 -2
@@ -331,10 +331,11 @@ static inline void lockdep_on(void)# define lock_set_subclass (l, s, i) do { } while (0)# define lockdep_init () do { } while (0)# define lockdep_info () do { } while (0) -# define lockdep_init_map (lock, name, key, sub) do { (void)(key); } while (0) +# define lockdep_init_map (lock, name, key, sub) \ + do { (void)(name); (void)(key); } while (0)# define lockdep_set_class (lock, key) do { (void)(key); } while (0)# define lockdep_set_class_and_name (lock, key, name) \ - do { (void)(key); } while (0) + do { (void)(key); (void)(name); } while (0)#define lockdep_set_class_and_subclass (lock, key, sub) \ do { (void)(key); } while (0)#define lockdep_set_subclass (lock, sub) do { } while (0)
include/net/sock.h +1 -1
@@ -815,7 +815,7 @@ static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)*/ #define sock_lock_init_class_and_name (sk, sname, skey, name, key) \ do { \ - sk->sk_lock.owned = 0; \ + sk->sk_lock.owned = 0; \ init_waitqueue_head(&sk->sk_lock.wq); \ spin_lock_init(&(sk)->sk_lock.slock); \ debug_check_no_locks_freed((void *)&(sk)->sk_lock, \
net/core/sock.c +0 -2
@@ -136,7 +136,6 @@static struct lock_class_key af_family_keys[AF_MAX ];static struct lock_class_key af_family_slock_keys[AF_MAX ]; -#ifdef CONFIG_DEBUG_LOCK_ALLOC /* * Make lock validator output more readable. (we pre-construct these * strings build-time, so that runtime initialization of socket
@@ -187,7 +186,6 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {"clock-AF_RXRPC" ,"clock-AF_ISDN" ,"clock-AF_PHONET" , "clock-AF_MAX" }; -#endif /* * sk_callback_lock locking rules are per-address-family,