projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35ed87a
)
mptcp: use list_first_entry_or_null
author
Geliang Tang
<geliangtang@gmail.com>
Mon, 15 Jun 2020 08:34:28 +0000
(16:34 +0800)
committer
David S. Miller
<davem@davemloft.net>
Mon, 15 Jun 2020 20:04:53 +0000
(13:04 -0700)
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>
net/mptcp/protocol.h
patch
|
blob
|
history
diff --git
a/net/mptcp/protocol.h
b/net/mptcp/protocol.h
index 70ed698bd2067965439f20b508db6f614e5b331f..db56535dfc29c7011d94ac5c2cede985b8fc063c 100644
(file)
--- 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 {