Skip to contentSkip to conversation

netpoll: Eliminate redundant assignment

PATCH Applied Breno Leitao 3 participants 3 messages Mar 19, 2025 – Mar 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netpoll: Eliminate redundant assignment

The assignment of zero to udph->check is unnecessary as it is immediately overwritten in the subsequent line. Remove the redundant assignment.

---
 net/core/netpoll.c | 1 -
 1 file changed, 1 deletion(-)
net/core/netpoll.c +0 -1
index 3cc3eae9def30..4e1dba572f5ac 100644
@@ -433,7 +433,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
 	udph->len = htons(udp_len);
 
 	if (np->ipv6) {
-		udph->check = 0;
 		udph->check = csum_ipv6_magic(&np->local_ip.in6,
 					      &np->remote_ip.in6,
 					      udp_len, IPPROTO_UDP,

---
base-commit: 23c9ff659140f97d44bf6fb59f89526a168f2b86
change-id: 20250319-netpoll_nit-6390753708bc

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Breno Leitao

The assignment of zero to udph->check is unnecessary as it is immediately overwritten in the subsequent line. Remove the redundant assignment.

---
 net/core/netpoll.c | 1 -
 1 file changed, 1 deletion(-)
net/core/netpoll.c +0 -2
index 3cc3eae9def30..4e1dba572f5ac 100644
@@ -433,7 +433,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
 	udph->len = htons(udp_len);
 
 	if (np->ipv6) {
-		udph->check = 0;
 		udph->check = csum_ipv6_magic(&np->local_ip.in6,
 					      &np->remote_ip.in6,
 					      udp_len, IPPROTO_UDP,
 
---
Quoted 2 lines

base-commit: 23c9ff659140f97d44bf6fb59f89526a168f2b86
change-id: 20250319-netpoll_nit-6390753708bc

#2 lore raw
In reply to Breno Leitao
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 19 Mar 2025 10:02:44 -0700 you wrote:

The assignment of zero to udph->check is unnecessary as it is immediately overwritten in the subsequent line. Remove the redundant assignment.

---
 net/core/netpoll.c | 1 -
 1 file changed, 1 deletion(-)

[...]

Here is the summary with links:
- [net-next] netpoll: Eliminate redundant assignment

    https://git.kernel.org/netdev/net-next/c/f1fce08e63fe

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html