diff options
author | Geliang Tang <geliangtang@gmail.com> | 2020-06-15 11:34:28 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-15 23:04:53 +0300 |
commit | a386bc5b2155bf1fc76229481ac7e7f2a646d966 (patch) | |
tree | a94fa8cbacb5c337be7d4e0c4b7334c4a440e116 /net | |
parent | 35ed87add7def6809cf7815cc495a6537bc3bb01 (diff) | |
download | linux-a386bc5b2155bf1fc76229481ac7e7f2a646d966.tar.xz |
mptcp: use list_first_entry_or_null
Use list_first_entry_or_null to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mptcp/protocol.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 70ed698bd206..db56535dfc29 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -232,10 +232,7 @@ static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk) { struct mptcp_sock *msk = mptcp_sk(sk); - if (list_empty(&msk->rtx_queue)) - return NULL; - - return list_first_entry(&msk->rtx_queue, struct mptcp_data_frag, list); + return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list); } struct mptcp_subflow_request_sock { |