Skip to content

Commit e25cf3d

Browse files
author
Ingo Molnar
committed
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>
1 parent 708b8ea commit e25cf3d

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎include/linux/lockdep.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,11 @@ static inline void lockdep_on(void)
336336
# define lock_set_subclass(l, s, i) do { } while (0)
337337
# define lockdep_init() do { } while (0)
338338
# define lockdep_info() do { } while (0)
339-
# define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0)
339+
# define lockdep_init_map(lock, name, key, sub) \
340+
do { (void)(name); (void)(key); } while (0)
340341
# define lockdep_set_class(lock, key) do { (void)(key); } while (0)
341342
# define lockdep_set_class_and_name(lock, key, name) \
342-
do { (void)(key); } while (0)
343+
do { (void)(key); (void)(name); } while (0)
343344
#define lockdep_set_class_and_subclass(lock, key, sub) \
344345
do { (void)(key); } while (0)
345346
#define lockdep_set_subclass(lock, sub) do { } while (0)

‎include/net/sock.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
815815
*/
816816
#define sock_lock_init_class_and_name(sk, sname, skey, name, key) \
817817
do { \
818-
sk->sk_lock.owned = 0; \
818+
sk->sk_lock.owned = 0; \
819819
init_waitqueue_head(&sk->sk_lock.wq); \
820820
spin_lock_init(&(sk)->sk_lock.slock); \
821821
debug_check_no_locks_freed((void *)&(sk)->sk_lock, \

‎net/core/sock.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
static struct lock_class_key af_family_keys[AF_MAX];
137137
static struct lock_class_key af_family_slock_keys[AF_MAX];
138138

139-
#ifdef CONFIG_DEBUG_LOCK_ALLOC
140139
/*
141140
* Make lock validator output more readable. (we pre-construct these
142141
* strings build-time, so that runtime initialization of socket
@@ -187,7 +186,6 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {
187186
"clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" ,
188187
"clock-AF_MAX"
189188
};
190-
#endif
191189

192190
/*
193191
* sk_callback_lock locking rules are per-address-family,

0 commit comments

Comments
 (0)