Skip to contentSkip to conversation

net: alteon: remove unused len variable

PATCH Applied Tom Rix 4 participants 4 messages Mar 31, 2023 – Apr 2, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 net: alteon: remove unused len variable

clang with W=1 reports drivers/net/ethernet/alteon/acenic.c:2438:10: error: variable
'len' set but not used [-Werror,-Wunused-but-set-variable]

                int i, len = 0;
                       ^

This variable is not used so remove it.

---
 drivers/net/ethernet/alteon/acenic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/alteon/acenic.c +1 -2
index d7762da8b2c0..eafef84fe3be 100644
@@ -2435,7 +2435,7 @@ static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
 	} else {
 		dma_addr_t mapping;
 		u32 vlan_tag = 0;
-		int i, len = 0;
+		int i;
 
 		mapping = ace_map_tx_skb(ap, skb, NULL, idx);
 		flagsize = (skb_headlen(skb) << 16);
@@ -2454,7 +2454,6 @@ static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
 			const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 			struct tx_ring_info *info;
 
-			len += skb_frag_size(frag);
 			info = ap->skb->tx_skbuff + idx;
 			desc = ap->tx_ring + idx;
 
Signature · 1 line
2.27.0
#2 lore raw
In reply to Tom Rix
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

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

Quoted 8 lines · On Fri, 31 Mar 2023 16:55:45 -0400 you wrote:

clang with W=1 reports drivers/net/ethernet/alteon/acenic.c:2438:10: error: variable
'len' set but not used [-Werror,-Wunused-but-set-variable]

                int i, len = 0;
                       ^

This variable is not used so remove it.

[...]

Here is the summary with links:
- net: alteon: remove unused len variable

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

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Tom Rix
Quoted 8 lines · Tom Rix

clang with W=1 reports drivers/net/ethernet/alteon/acenic.c:2438:10: error: variable
'len' set but not used [-Werror,-Wunused-but-set-variable]

                 int i, len = 0;
                        ^

This variable is not used so remove it.

Quoted 25 lines
---
  drivers/net/ethernet/alteon/acenic.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/alteon/acenic.c +1 -2
index d7762da8b2c0..eafef84fe3be 100644
@@ -2435,7 +2435,7 @@ static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
  	} else {
  		dma_addr_t mapping;
  		u32 vlan_tag = 0;
-		int i, len = 0;
+		int i;
 
  		mapping = ace_map_tx_skb(ap, skb, NULL, idx);
  		flagsize = (skb_headlen(skb) << 16);
@@ -2454,7 +2454,6 @@ static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
  			const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
  			struct tx_ring_info *info;
 
-			len += skb_frag_size(frag);
  			info = ap->skb->tx_skbuff + idx;
  			desc = ap->tx_ring + idx;