All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
@ 2021-11-04 14:37 Nghia Le
  2021-11-04 16:44 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nghia Le @ 2021-11-04 14:37 UTC (permalink / raw)
  To: edumazet, davem, yoshfuji, dsahern, kuba, ast, daniel, andrii,
	kafai, songliubraving, yhs, john.fastabend, kpsingh
  Cc: Nghia Le, netdev, linux-kernel, bpf, kernel-janitors, lukas.bulwahn

The newinet value is initialized with inet_sk() in a block code to
handle sockets for the ETH_P_IP protocol. Along this code path,
newinet is never read. Thus, assignment to newinet is needless and
can be removed.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 net/ipv6/tcp_ipv6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2cc9b0e53ad1..551fce49841d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
 
 		inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
 
-		newinet = inet_sk(newsk);
 		newnp = tcp_inet6_sk(newsk);
 		newtp = tcp_sk(newsk);
 
-- 
2.25.1


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

* Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
  2021-11-04 14:37 [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() Nghia Le
@ 2021-11-04 16:44 ` Eric Dumazet
  2021-11-06  3:00 ` patchwork-bot+netdevbpf
  2021-11-06  8:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2021-11-04 16:44 UTC (permalink / raw)
  To: Nghia Le, edumazet, davem, yoshfuji, dsahern, kuba, ast, daniel,
	andrii, kafai, songliubraving, yhs, john.fastabend, kpsingh
  Cc: netdev, linux-kernel, bpf, kernel-janitors, lukas.bulwahn



On 11/4/21 7:37 AM, Nghia Le wrote:
> The newinet value is initialized with inet_sk() in a block code to
> handle sockets for the ETH_P_IP protocol. Along this code path,
> newinet is never read. Thus, assignment to newinet is needless and
> can be removed.
> 
> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> ---
>  net/ipv6/tcp_ipv6.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 2cc9b0e53ad1..551fce49841d 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
>  
>  		inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
>  
> -		newinet = inet_sk(newsk);
>  		newnp = tcp_inet6_sk(newsk);
>  		newtp = tcp_sk(newsk);
>  
> 

Reviewed-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
  2021-11-04 14:37 [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() Nghia Le
  2021-11-04 16:44 ` Eric Dumazet
@ 2021-11-06  3:00 ` patchwork-bot+netdevbpf
  2021-11-06  8:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-06  3:00 UTC (permalink / raw)
  To: Nghia Le
  Cc: edumazet, davem, yoshfuji, dsahern, kuba, ast, daniel, andrii,
	kafai, songliubraving, yhs, john.fastabend, kpsingh, netdev,
	linux-kernel, bpf, kernel-janitors, lukas.bulwahn

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  4 Nov 2021 21:37:40 +0700 you wrote:
> The newinet value is initialized with inet_sk() in a block code to
> handle sockets for the ETH_P_IP protocol. Along this code path,
> newinet is never read. Thus, assignment to newinet is needless and
> can be removed.
> 
> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> 
> [...]

Here is the summary with links:
  - ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
    https://git.kernel.org/netdev/net/c/70bf363d7adb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
  2021-11-04 14:37 [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() Nghia Le
  2021-11-04 16:44 ` Eric Dumazet
  2021-11-06  3:00 ` patchwork-bot+netdevbpf
@ 2021-11-06  8:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-06  8:50 UTC (permalink / raw)
  To: Nghia Le
  Cc: edumazet, davem, yoshfuji, dsahern, kuba, ast, daniel, andrii,
	kafai, songliubraving, yhs, john.fastabend, kpsingh, netdev,
	linux-kernel, bpf, kernel-janitors, lukas.bulwahn

Hello:

This patch was applied to bpf/bpf.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  4 Nov 2021 21:37:40 +0700 you wrote:
> The newinet value is initialized with inet_sk() in a block code to
> handle sockets for the ETH_P_IP protocol. Along this code path,
> newinet is never read. Thus, assignment to newinet is needless and
> can be removed.
> 
> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> 
> [...]

Here is the summary with links:
  - ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
    https://git.kernel.org/bpf/bpf/c/70bf363d7adb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
  2021-11-04  6:50 ` Lukas Bulwahn
@ 2021-11-04 14:42   ` Nghia Le
  0 siblings, 0 replies; 7+ messages in thread
From: Nghia Le @ 2021-11-04 14:42 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-safety

On Thu, Nov 04, 2021 at 07:50:18AM +0100, Lukas Bulwahn wrote:
> On Thu, Nov 4, 2021 at 12:28 AM Nghia Le <nghialm78@gmail.com> wrote:
> >
> > The newinet value is initialized with inet_sk() in a block code starting
> > from checking condition of protocol to exiting by returning newsk
> > structure. Along the code path, newinet is never read. Thus, assignment
> > to newinet is wredundant and can be removed.
> >
> 
> Just a bit improving your English:
> 
> s/in a block code starting from checking condition of protocol to
> exiting by returning newsk structure/in a block code to handle sockets
> for the ETH_P_IP protocol/
> 
> s/Along the code path/Along this code path/
> 
> s/wredundant/redundant/
> 
> I would prefer "needless" or "useless" to "redundant", but all words are okay.
> 
> Lukas
> 
> > Signed-off-by: Nghia Le <nghialm78@gmail.com>
> > ---
> >  net/ipv6/tcp_ipv6.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> > index 2cc9b0e53ad1..551fce49841d 100644
> > --- a/net/ipv6/tcp_ipv6.c
> > +++ b/net/ipv6/tcp_ipv6.c
> > @@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
> >
> >                 inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
> >
> > -               newinet = inet_sk(newsk);
> >                 newnp = tcp_inet6_sk(newsk);
> >                 newtp = tcp_sk(newsk);
> >
> > --
> > 2.25.1
> >
Thanks Lukas, I revised and submitted patch to public mailing list.
Best regards,
Nghia Le


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

* Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
  2021-11-03 23:27 Nghia Le
@ 2021-11-04  6:50 ` Lukas Bulwahn
  2021-11-04 14:42   ` Nghia Le
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Bulwahn @ 2021-11-04  6:50 UTC (permalink / raw)
  To: Nghia Le; +Cc: linux-safety

On Thu, Nov 4, 2021 at 12:28 AM Nghia Le <nghialm78@gmail.com> wrote:
>
> The newinet value is initialized with inet_sk() in a block code starting
> from checking condition of protocol to exiting by returning newsk
> structure. Along the code path, newinet is never read. Thus, assignment
> to newinet is wredundant and can be removed.
>

Just a bit improving your English:

s/in a block code starting from checking condition of protocol to
exiting by returning newsk structure/in a block code to handle sockets
for the ETH_P_IP protocol/

s/Along the code path/Along this code path/

s/wredundant/redundant/

I would prefer "needless" or "useless" to "redundant", but all words are okay.

Lukas

> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> ---
>  net/ipv6/tcp_ipv6.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 2cc9b0e53ad1..551fce49841d 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
>
>                 inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
>
> -               newinet = inet_sk(newsk);
>                 newnp = tcp_inet6_sk(newsk);
>                 newtp = tcp_sk(newsk);
>
> --
> 2.25.1
>


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

* [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
@ 2021-11-03 23:27 Nghia Le
  2021-11-04  6:50 ` Lukas Bulwahn
  0 siblings, 1 reply; 7+ messages in thread
From: Nghia Le @ 2021-11-03 23:27 UTC (permalink / raw)
  To: linux-safety, lukas.bulwahn; +Cc: Nghia Le

The newinet value is initialized with inet_sk() in a block code starting
from checking condition of protocol to exiting by returning newsk
structure. Along the code path, newinet is never read. Thus, assignment
to newinet is wredundant and can be removed.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 net/ipv6/tcp_ipv6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2cc9b0e53ad1..551fce49841d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
 
 		inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
 
-		newinet = inet_sk(newsk);
 		newnp = tcp_inet6_sk(newsk);
 		newtp = tcp_sk(newsk);
 
-- 
2.25.1



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

end of thread, other threads:[~2021-11-06  8:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 14:37 [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() Nghia Le
2021-11-04 16:44 ` Eric Dumazet
2021-11-06  3:00 ` patchwork-bot+netdevbpf
2021-11-06  8:50 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-11-03 23:27 Nghia Le
2021-11-04  6:50 ` Lukas Bulwahn
2021-11-04 14:42   ` Nghia Le

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.