Skip to contentSkip to conversation

net: ena: removed unused tx_bytes variable

PATCH Applied Simon Horman 4 participants 4 messages Mar 28, 2023 – Mar 30, 2023

Subsystems (3)
lore
Share & tools
lore

Simon Horman

author reviewer
#0 lore raw

PATCH 1/1 net: ena: removed unused tx_bytes variable

clang 16.0.0 with W=1 reports:

drivers/net/ethernet/amazon/ena/ena_netdev.c:1901:6: error: variable 'tx_bytes' set but not used [-Werror,-Wunused-but-set-variable]

        u32 tx_bytes = 0;

The variable is not used so remove it.

---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -2
index e0588a82c8e5..e6a6efaeb87c 100644
@@ -1898,7 +1898,6 @@ static int ena_clean_xdp_irq(struct ena_ring *xdp_ring, u32 budget)
 {
 	u32 total_done = 0;
 	u16 next_to_clean;
-	u32 tx_bytes = 0;
 	int tx_pkts = 0;
 	u16 req_id;
 	int rc;
@@ -1936,7 +1935,6 @@ static int ena_clean_xdp_irq(struct ena_ring *xdp_ring, u32 budget)
 			  "tx_poll: q %d skb %p completed\n", xdp_ring->qid,
 			  xdpf);
 
-		tx_bytes += xdpf->len;
 		tx_pkts++;
 		total_done += tx_info->tx_descs;
 
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · Simon Horman

clang 16.0.0 with W=1 reports:

drivers/net/ethernet/amazon/ena/ena_netdev.c:1901:6: error: variable 'tx_bytes' set but not used [-Werror,-Wunused-but-set-variable]

        u32 tx_bytes = 0;

The variable is not used so remove it.

---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -1
index e0588a82c8e5..e6a6efaeb87c 100644
@@ -1898,7 +1898,6 @@ static int ena_clean_xdp_irq(struct 
 ena_ring *xdp_ring, u32 budget)
 {
 	u32 total_done = 0;
 	u16 next_to_clean;
-	u32 tx_bytes = 0;
 	int tx_pkts = 0;
 	u16 req_id;
drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -1
 	int rc;
@@ -1936,7 +1935,6 @@ static int ena_clean_xdp_irq(struct 
 ena_ring *xdp_ring, u32 budget)
 			  "tx_poll: q %d skb %p completed\n", 
 xdp_ring->qid,
 			  xdpf);
 
-		tx_bytes += xdpf->len;
 		tx_pkts++;
Quoted 1 line

total_done += tx_info->tx_descs;

Thanks for submitting this change.

#2 lore raw
In reply to Simon Horman
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 8 lines · On Tue, 28 Mar 2023 17:19:58 +0200 you wrote:

clang 16.0.0 with W=1 reports:

drivers/net/ethernet/amazon/ena/ena_netdev.c:1901:6: error: variable 'tx_bytes' set but not used [-Werror,-Wunused-but-set-variable]

        u32 tx_bytes = 0;

The variable is not used so remove it.

[...]

Here is the summary with links:
- [net-next] net: ena: removed unused tx_bytes variable

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

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
maintainer Applied
#3 lore raw
In reply to Simon Horman
Quoted 8 lines · On Tue, 28 Mar 2023 17:19:58 +0200 Simon Horman wrote:

clang 16.0.0 with W=1 reports:

drivers/net/ethernet/amazon/ena/ena_netdev.c:1901:6: error: variable 'tx_bytes' set but not used [-Werror,-Wunused-but-set-variable]

        u32 tx_bytes = 0;

The variable is not used so remove it.

Applied, thanks!