[PATCH mptcp-next] mptcp: remove unused returned value

Matthieu Baerts (NGI0) posted 1 patch 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20250906-check._5Fdata._5Ffin._5Fret-v1-1-2c8100bc20eb@kernel.org
net/mptcp/protocol.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH mptcp-next] mptcp: remove unused returned value
Posted by Matthieu Baerts (NGI0) 5 months ago
When working on a fix modifying mptcp_check_data_fin(), I noticed the
returned value was no longer used.

It looks like it was used for 3 days, between commit 7ed90803a213
("mptcp: send explicit ack on delayed ack_seq incr") and commit
ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling").

This returned value can be safely removed.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/protocol.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1c26acf6c4145896ecbb5c7f7004121c66a20649..f3dda47ad1d70b5c6a326c17dbe6d244c5638ca2 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -530,11 +530,10 @@ static void mptcp_cleanup_rbuf(struct mptcp_sock *msk, int copied)
 	}
 }
 
-static bool mptcp_check_data_fin(struct sock *sk)
+static void mptcp_check_data_fin(struct sock *sk)
 {
 	struct mptcp_sock *msk = mptcp_sk(sk);
 	u64 rcv_data_fin_seq;
-	bool ret = false;
 
 	/* Need to ack a DATA_FIN received from a peer while this side
 	 * of the connection is in ESTABLISHED, FIN_WAIT1, or FIN_WAIT2.
@@ -572,12 +571,10 @@ static bool mptcp_check_data_fin(struct sock *sk)
 			break;
 		}
 
-		ret = true;
 		if (!__mptcp_check_fallback(msk))
 			mptcp_send_ack(msk);
 		mptcp_close_wake_up(sk);
 	}
-	return ret;
 }
 
 static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk)

---
base-commit: e9091ee333eb716a0933dcb08617228dcd3d3623
change-id: 20250906-check_data_fin_ret-6d284170880a

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH mptcp-next] mptcp: remove unused returned value
Posted by Geliang Tang 5 months ago
Hi Matt,

On Sat, 2025-09-06 at 16:13 +0200, Matthieu Baerts (NGI0) wrote:
> When working on a fix modifying mptcp_check_data_fin(), I noticed the
> returned value was no longer used.
> 
> It looks like it was used for 3 days, between commit 7ed90803a213
> ("mptcp: send explicit ack on delayed ack_seq incr") and commit
> ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling").
> 
> This returned value can be safely removed.
> 
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

LGTM!

Reviewed-by: Geliang Tang <geliang@kernel.org>

Thanks,
-Geliang

> ---
>  net/mptcp/protocol.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index
> 1c26acf6c4145896ecbb5c7f7004121c66a20649..f3dda47ad1d70b5c6a326c17dbe
> 6d244c5638ca2 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -530,11 +530,10 @@ static void mptcp_cleanup_rbuf(struct
> mptcp_sock *msk, int copied)
>  	}
>  }
>  
> -static bool mptcp_check_data_fin(struct sock *sk)
> +static void mptcp_check_data_fin(struct sock *sk)
>  {
>  	struct mptcp_sock *msk = mptcp_sk(sk);
>  	u64 rcv_data_fin_seq;
> -	bool ret = false;
>  
>  	/* Need to ack a DATA_FIN received from a peer while this
> side
>  	 * of the connection is in ESTABLISHED, FIN_WAIT1, or
> FIN_WAIT2.
> @@ -572,12 +571,10 @@ static bool mptcp_check_data_fin(struct sock
> *sk)
>  			break;
>  		}
>  
> -		ret = true;
>  		if (!__mptcp_check_fallback(msk))
>  			mptcp_send_ack(msk);
>  		mptcp_close_wake_up(sk);
>  	}
> -	return ret;
>  }
>  
>  static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock
> *ssk)
> 
> ---
> base-commit: e9091ee333eb716a0933dcb08617228dcd3d3623
> change-id: 20250906-check_data_fin_ret-6d284170880a
> 
> Best regards,
Re: [PATCH mptcp-next] mptcp: remove unused returned value
Posted by Geliang Tang 5 months ago
Hi Matt,

On Wed, 2025-09-10 at 11:38 +0800, Geliang Tang wrote:
> Hi Matt,
> 
> On Sat, 2025-09-06 at 16:13 +0200, Matthieu Baerts (NGI0) wrote:
> > When working on a fix modifying mptcp_check_data_fin(), I noticed
> > the
> > returned value was no longer used.
> > 
> > It looks like it was used for 3 days, between commit 7ed90803a213
> > ("mptcp: send explicit ack on delayed ack_seq incr") and commit
> > ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling").
> > 
> > This returned value can be safely removed.
> > 
> > Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> 
> LGTM!
> 
> Reviewed-by: Geliang Tang <geliang@kernel.org>

Please update the subject when applying this patch, similar to this:

mptcp: remove unused returned value of check_data_fin

Thanks,
-Geliang

> 
> Thanks,
> -Geliang
> 
> > ---
> >  net/mptcp/protocol.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> > 
> > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> > index
> > 1c26acf6c4145896ecbb5c7f7004121c66a20649..f3dda47ad1d70b5c6a326c17d
> > be
> > 6d244c5638ca2 100644
> > --- a/net/mptcp/protocol.c
> > +++ b/net/mptcp/protocol.c
> > @@ -530,11 +530,10 @@ static void mptcp_cleanup_rbuf(struct
> > mptcp_sock *msk, int copied)
> >  	}
> >  }
> >  
> > -static bool mptcp_check_data_fin(struct sock *sk)
> > +static void mptcp_check_data_fin(struct sock *sk)
> >  {
> >  	struct mptcp_sock *msk = mptcp_sk(sk);
> >  	u64 rcv_data_fin_seq;
> > -	bool ret = false;
> >  
> >  	/* Need to ack a DATA_FIN received from a peer while this
> > side
> >  	 * of the connection is in ESTABLISHED, FIN_WAIT1, or
> > FIN_WAIT2.
> > @@ -572,12 +571,10 @@ static bool mptcp_check_data_fin(struct sock
> > *sk)
> >  			break;
> >  		}
> >  
> > -		ret = true;
> >  		if (!__mptcp_check_fallback(msk))
> >  			mptcp_send_ack(msk);
> >  		mptcp_close_wake_up(sk);
> >  	}
> > -	return ret;
> >  }
> >  
> >  static void mptcp_dss_corruption(struct mptcp_sock *msk, struct
> > sock
> > *ssk)
> > 
> > ---
> > base-commit: e9091ee333eb716a0933dcb08617228dcd3d3623
> > change-id: 20250906-check_data_fin_ret-6d284170880a
> > 
> > Best regards,
Re: [PATCH mptcp-next] mptcp: remove unused returned value
Posted by Matthieu Baerts 5 months ago
Hi Geliang,

On 10/09/2025 05:44, Geliang Tang wrote:
> Hi Matt,
> 
> On Wed, 2025-09-10 at 11:38 +0800, Geliang Tang wrote:
>> Hi Matt,
>>
>> On Sat, 2025-09-06 at 16:13 +0200, Matthieu Baerts (NGI0) wrote:
>>> When working on a fix modifying mptcp_check_data_fin(), I noticed
>>> the
>>> returned value was no longer used.
>>>
>>> It looks like it was used for 3 days, between commit 7ed90803a213
>>> ("mptcp: send explicit ack on delayed ack_seq incr") and commit
>>> ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling").
>>>
>>> This returned value can be safely removed.
>>>
>>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>>
>> LGTM!
>>
>> Reviewed-by: Geliang Tang <geliang@kernel.org>
> 
> Please update the subject when applying this patch, similar to this:
> 
> mptcp: remove unused returned value of check_data_fin

Done. Thank you for the review!

Now in our tree:

New patches for t/upstream:
- f99b062ae907: mptcp: remove unused returned value of check_data_fin
- Results: 1e51af26b216..2356642572b2 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/961890711378b6cf214799da98794038222fc86a/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next] mptcp: remove unused returned value
Posted by MPTCP CI 5 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Unstable: 1 failed test(s): selftest_mptcp_connect_checksum 🔴
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/17515731496

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/ffb29b394e92
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=999625


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)