aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-04-07 20:40:25 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-07 20:40:25 -0400
commitb33b0a1bf69faff89693df49519fa7b459f5d807 (patch)
treea8de7deda833a9e7cfd837da4abe2140eb506fd3
parent03be98226c14d787939381b9f42d81764ea8eedc (diff)
net: Fix build failure due to lockdep_sock_is_held().
Needs to be protected with CONFIG_LOCKDEP. Based upon a patch by Hannes Frederic Sowa. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 46b29374df8e..81d6fecec0a2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1360,6 +1360,7 @@ do { \
1360 lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ 1360 lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \
1361} while (0) 1361} while (0)
1362 1362
1363#ifdef CONFIG_LOCKDEP
1363static inline bool lockdep_sock_is_held(const struct sock *csk) 1364static inline bool lockdep_sock_is_held(const struct sock *csk)
1364{ 1365{
1365 struct sock *sk = (struct sock *)csk; 1366 struct sock *sk = (struct sock *)csk;
@@ -1367,6 +1368,7 @@ static inline bool lockdep_sock_is_held(const struct sock *csk)
1367 return lockdep_is_held(&sk->sk_lock) || 1368 return lockdep_is_held(&sk->sk_lock) ||
1368 lockdep_is_held(&sk->sk_lock.slock); 1369 lockdep_is_held(&sk->sk_lock.slock);
1369} 1370}
1371#endif
1370 1372
1371void lock_sock_nested(struct sock *sk, int subclass); 1373void lock_sock_nested(struct sock *sk, int subclass);
1372 1374