[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460072118-10006-1-git-send-email-hannes@stressinduktion.org>
Date: Fri, 8 Apr 2016 01:35:18 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: netdev@...r.kernel.org
Cc: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>
Subject: [PATCH net-next v2] sock: make lockdep_sock_is_held inline and conditional on LOCKDEP
lockdep_is_held is only specified if CONFIG_LOCKDEP is defined, so make
it depending on it.
Also add the missing inline keyword, so no warnings about unused functions
show up during complilation.
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>
Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
---
include/net/sock.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index eb2d7c3e120b25..81d6fecec0a2c0 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1360,13 +1360,15 @@ do { \
lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \
} while (0)
-static bool lockdep_sock_is_held(const struct sock *csk)
+#ifdef CONFIG_LOCKDEP
+static inline bool lockdep_sock_is_held(const struct sock *csk)
{
struct sock *sk = (struct sock *)csk;
return lockdep_is_held(&sk->sk_lock) ||
lockdep_is_held(&sk->sk_lock.slock);
}
+#endif
void lock_sock_nested(struct sock *sk, int subclass);
--
2.5.5
Powered by blists - more mailing lists