lockdep: include/linux/lockdep.h - fix warning in net/bluetooth/af_bluetooth.c

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

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Ingo Molnar and committed by David S. Miller e8f6fbf6 1fa989e8

+4 -5
+3 -2
include/linux/lockdep.h
··· 331 # define lock_set_subclass(l, s, i) do { } while (0) 332 # define lockdep_init() do { } while (0) 333 # define lockdep_info() do { } while (0) 334 - # define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0) 335 # define lockdep_set_class(lock, key) do { (void)(key); } while (0) 336 # define lockdep_set_class_and_name(lock, key, name) \ 337 - do { (void)(key); } while (0) 338 #define lockdep_set_class_and_subclass(lock, key, sub) \ 339 do { (void)(key); } while (0) 340 #define lockdep_set_subclass(lock, sub) do { } while (0)
··· 331 # define lock_set_subclass(l, s, i) do { } while (0) 332 # define lockdep_init() do { } while (0) 333 # define lockdep_info() do { } while (0) 334 + # define lockdep_init_map(lock, name, key, sub) \ 335 + do { (void)(name); (void)(key); } while (0) 336 # define lockdep_set_class(lock, key) do { (void)(key); } while (0) 337 # define lockdep_set_class_and_name(lock, key, name) \ 338 + do { (void)(key); (void)(name); } while (0) 339 #define lockdep_set_class_and_subclass(lock, key, sub) \ 340 do { (void)(key); } while (0) 341 #define lockdep_set_subclass(lock, sub) do { } while (0)
+1 -1
include/net/sock.h
··· 815 */ 816 #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ 817 do { \ 818 - sk->sk_lock.owned = 0; \ 819 init_waitqueue_head(&sk->sk_lock.wq); \ 820 spin_lock_init(&(sk)->sk_lock.slock); \ 821 debug_check_no_locks_freed((void *)&(sk)->sk_lock, \
··· 815 */ 816 #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ 817 do { \ 818 + sk->sk_lock.owned = 0; \ 819 init_waitqueue_head(&sk->sk_lock.wq); \ 820 spin_lock_init(&(sk)->sk_lock.slock); \ 821 debug_check_no_locks_freed((void *)&(sk)->sk_lock, \
-2
net/core/sock.c
··· 136 static struct lock_class_key af_family_keys[AF_MAX]; 137 static struct lock_class_key af_family_slock_keys[AF_MAX]; 138 139 - #ifdef CONFIG_DEBUG_LOCK_ALLOC 140 /* 141 * Make lock validator output more readable. (we pre-construct these 142 * strings build-time, so that runtime initialization of socket ··· 186 "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , 187 "clock-AF_MAX" 188 }; 189 - #endif 190 191 /* 192 * sk_callback_lock locking rules are per-address-family,
··· 136 static struct lock_class_key af_family_keys[AF_MAX]; 137 static struct lock_class_key af_family_slock_keys[AF_MAX]; 138 139 /* 140 * Make lock validator output more readable. (we pre-construct these 141 * strings build-time, so that runtime initialization of socket ··· 187 "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , 188 "clock-AF_MAX" 189 }; 190 191 /* 192 * sk_callback_lock locking rules are per-address-family,