linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mptcp: use list_first_entry_or_null
@ 2020-06-12  6:05 Geliang Tang
  2020-06-12 18:22 ` Mat Martineau
  0 siblings, 1 reply; 3+ messages in thread
From: Geliang Tang @ 2020-06-12  6:05 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
  Cc: Geliang Tang, netdev, mptcp, linux-kernel

Use list_first_entry_or_null to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/protocol.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 86d265500cf6..55c65abcad64 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -234,10 +234,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 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mptcp: use list_first_entry_or_null
  2020-06-12  6:05 [PATCH] mptcp: use list_first_entry_or_null Geliang Tang
@ 2020-06-12 18:22 ` Mat Martineau
  2020-06-15  8:48   ` Geliang Tang
  0 siblings, 1 reply; 3+ messages in thread
From: Mat Martineau @ 2020-06-12 18:22 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Matthieu Baerts, David S. Miller, Jakub Kicinski, netdev, mptcp,
	linux-kernel


Hello Geliang,

On Fri, 12 Jun 2020, Geliang Tang wrote:

> Use list_first_entry_or_null to simplify the code.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/protocol.h | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 86d265500cf6..55c65abcad64 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -234,10 +234,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 {
> -- 
> 2.17.1

As Matthieu mentioned on your earlier patch, please submit patches to 
netdev with either a [PATCH net] or [PATCH net-next] tag. In this case, 
these are non-critical bug fixes so they should be targeted at net-next.

Note that net-next branch is currently closed to submissions due to the 
v5.8 merge window. Please resubmit both MPTCP patches for net-next when 
David announces that it is open again. The change does look ok but will 
not be merged now.

Thanks for your patch,

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mptcp: use list_first_entry_or_null
  2020-06-12 18:22 ` Mat Martineau
@ 2020-06-15  8:48   ` Geliang Tang
  0 siblings, 0 replies; 3+ messages in thread
From: Geliang Tang @ 2020-06-15  8:48 UTC (permalink / raw)
  To: Mat Martineau
  Cc: Matthieu Baerts, David S. Miller, Jakub Kicinski, Paolo Abeni,
	Peter Krystad, netdev, mptcp, linux-kernel

On Fri, Jun 12, 2020 at 11:22:31AM -0700, Mat Martineau wrote:
> 
> Hello Geliang,
> 
> On Fri, 12 Jun 2020, Geliang Tang wrote:
> 
> > Use list_first_entry_or_null to simplify the code.
> > 
> > Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> > ---
> > net/mptcp/protocol.h | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> > 
> > diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> > index 86d265500cf6..55c65abcad64 100644
> > --- a/net/mptcp/protocol.h
> > +++ b/net/mptcp/protocol.h
> > @@ -234,10 +234,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 {
> > -- 
> > 2.17.1
> 
> As Matthieu mentioned on your earlier patch, please submit patches to netdev
> with either a [PATCH net] or [PATCH net-next] tag. In this case, these are
> non-critical bug fixes so they should be targeted at net-next.
> 
> Note that net-next branch is currently closed to submissions due to the v5.8
> merge window. Please resubmit both MPTCP patches for net-next when David
> announces that it is open again. The change does look ok but will not be
> merged now.
> 
> Thanks for your patch,
> 
> --
> Mat Martineau
> Intel

Hi Mat,

Thanks for your reply.
I have already resend patch v2 to you.

-Geliang

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-15  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  6:05 [PATCH] mptcp: use list_first_entry_or_null Geliang Tang
2020-06-12 18:22 ` Mat Martineau
2020-06-15  8:48   ` Geliang Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).