diff options
author | Paolo Abeni <pabeni@redhat.com> | 2021-09-25 00:12:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-25 13:36:51 +0300 |
commit | 765ff425528f309b166978c4b295eb47ebefd47a (patch) | |
tree | da891ca83ac4f214a003b3b509a3863823508001 /net/mptcp/protocol.c | |
parent | 13ac17a32bf1fefbc0bd412545a907979fda26b6 (diff) | |
download | linux-765ff425528f309b166978c4b295eb47ebefd47a.tar.xz |
mptcp: use lockdep_assert_held_once() instead of open-coding it
We have a few more places where the mptcp code duplicates
lockdep_assert_held_once(). Let's use the existing macro and
avoid a bunch of compiler's conditional.
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/protocol.c')
-rw-r--r-- | net/mptcp/protocol.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 3d1757b8ef69..87ee409d68ab 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -956,9 +956,7 @@ static void __mptcp_update_wmem(struct sock *sk) { struct mptcp_sock *msk = mptcp_sk(sk); -#ifdef CONFIG_LOCKDEP - WARN_ON_ONCE(!lockdep_is_held(&sk->sk_lock.slock)); -#endif + lockdep_assert_held_once(&sk->sk_lock.slock); if (!msk->wmem_reserved) return; @@ -1117,9 +1115,8 @@ out: static void __mptcp_clean_una_wakeup(struct sock *sk) { -#ifdef CONFIG_LOCKDEP - WARN_ON_ONCE(!lockdep_is_held(&sk->sk_lock.slock)); -#endif + lockdep_assert_held_once(&sk->sk_lock.slock); + __mptcp_clean_una(sk); mptcp_write_space(sk); } |