netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] mptcp: Remove set but not used variable 'can_ack'
@ 2020-03-18  2:01 YueHaibing
  2020-03-18  9:26 ` Paolo Abeni
  2020-03-22  3:21 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2020-03-18  2:01 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, pabeni, David S . Miller, Jakub Kicinski
  Cc: YueHaibing, netdev, mptcp, linux-kernel

Fixes gcc '-Wunused-but-set-variable' warning:

net/mptcp/options.c: In function 'mptcp_established_options_dss':
net/mptcp/options.c:338:7: warning:
 variable 'can_ack' set but not used [-Wunused-but-set-variable]

commit dc093db5cc05 ("mptcp: drop unneeded checks")
leave behind this unused, remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/mptcp/options.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 63c8ee49cef2..8ba34950241c 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -335,7 +335,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 	struct mptcp_sock *msk;
 	unsigned int ack_size;
 	bool ret = false;
-	bool can_ack;
 	u8 tcp_fin;
 
 	if (skb) {
@@ -364,7 +363,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 	/* passive sockets msk will set the 'can_ack' after accept(), even
 	 * if the first subflow may have the already the remote key handy
 	 */
-	can_ack = true;
 	opts->ext_copy.use_ack = 0;
 	msk = mptcp_sk(subflow->conn);
 	if (!READ_ONCE(msk->can_ack)) {




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

* Re: [PATCH net-next] mptcp: Remove set but not used variable 'can_ack'
  2020-03-18  2:01 [PATCH net-next] mptcp: Remove set but not used variable 'can_ack' YueHaibing
@ 2020-03-18  9:26 ` Paolo Abeni
  2020-03-22  3:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2020-03-18  9:26 UTC (permalink / raw)
  To: YueHaibing
  Cc: netdev, mptcp, linux-kernel, Mat Martineau, Matthieu Baerts,
	David S . Miller, Jakub Kicinski

On Wed, 2020-03-18 at 02:01 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> net/mptcp/options.c: In function 'mptcp_established_options_dss':
> net/mptcp/options.c:338:7: warning:
>  variable 'can_ack' set but not used [-Wunused-but-set-variable]
> 
> commit dc093db5cc05 ("mptcp: drop unneeded checks")
> leave behind this unused, remove it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  net/mptcp/options.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 63c8ee49cef2..8ba34950241c 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -335,7 +335,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
>  	struct mptcp_sock *msk;
>  	unsigned int ack_size;
>  	bool ret = false;
> -	bool can_ack;
>  	u8 tcp_fin;
>  
>  	if (skb) {
> @@ -364,7 +363,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
>  	/* passive sockets msk will set the 'can_ack' after accept(), even
>  	 * if the first subflow may have the already the remote key handy
>  	 */
> -	can_ack = true;
>  	opts->ext_copy.use_ack = 0;
>  	msk = mptcp_sk(subflow->conn);
>  	if (!READ_ONCE(msk->can_ack)) {

Yep, left-over on my side! Thanks for clearing it!

Acked-by: Paolo Abeni <pabeni@redhat.com>


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

* Re: [PATCH net-next] mptcp: Remove set but not used variable 'can_ack'
  2020-03-18  2:01 [PATCH net-next] mptcp: Remove set but not used variable 'can_ack' YueHaibing
  2020-03-18  9:26 ` Paolo Abeni
@ 2020-03-22  3:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-03-22  3:21 UTC (permalink / raw)
  To: yuehaibing
  Cc: mathew.j.martineau, matthieu.baerts, pabeni, kuba, netdev, mptcp,
	linux-kernel

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 18 Mar 2020 02:01:57 +0000

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> net/mptcp/options.c: In function 'mptcp_established_options_dss':
> net/mptcp/options.c:338:7: warning:
>  variable 'can_ack' set but not used [-Wunused-but-set-variable]
> 
> commit dc093db5cc05 ("mptcp: drop unneeded checks")
> leave behind this unused, remove it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied, thanks.

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

end of thread, other threads:[~2020-03-22  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18  2:01 [PATCH net-next] mptcp: Remove set but not used variable 'can_ack' YueHaibing
2020-03-18  9:26 ` Paolo Abeni
2020-03-22  3:21 ` David Miller

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).