[PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

Subsystems: networking [general], networking [tcp], the rest

STALE1739d LANDED

Landed in mainline as 70bf363d7adb on 2021-11-06.

4 messages, 3 authors, 2021-11-06 · open the first message on its own page

[PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

From: Nghia Le <hidden>
Date: 2021-11-04 14:39:36

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 <redacted>
---
 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

Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

From: Eric Dumazet <hidden>
Date: 2021-11-04 16:44:34


On 11/4/21 7:37 AM, Nghia Le wrote:
quoted hunk
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 <redacted>
---
 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>

Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-06 03:00:10

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:

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 <redacted>

[...]
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

Re: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-06 08:50:14

Hello:

This patch was applied to bpf/bpf.git (master)
by Jakub Kicinski [off-list ref]:

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 <redacted>

[...]
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help