diff mbox series

[net-next] net: ena: removed unused tx_bytes variable

Message ID 20230328151958.410687-1-horms@kernel.org (mailing list archive)
State Accepted
Commit c5370374bb1bf692167c7276be8b56c02565d535
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ena: removed unused tx_bytes variable | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers warning 3 maintainers not CCed: nathan@kernel.org llvm@lists.linux.dev ndesaulniers@google.com
netdev/build_clang success Errors and warnings before: 20 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Simon Horman March 28, 2023, 3:19 p.m. UTC
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.

Signed-off-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Shay Agroskin March 28, 2023, 8:02 p.m. UTC | #1
Simon Horman <horms@kernel.org> writes:

> 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.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c 
> b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index e0588a82c8e5..e6a6efaeb87c 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -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;

Thanks for submitting this change.

Acked-by: Shay Agroskin <shayagr@amazon.com>
patchwork-bot+netdevbpf@kernel.org March 30, 2023, 5:20 a.m. UTC | #2
Hello:

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

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!
Jakub Kicinski March 30, 2023, 5:21 a.m. UTC | #3
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.
> 
> Signed-off-by: Simon Horman <horms@kernel.org>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index e0588a82c8e5..e6a6efaeb87c 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -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;