diff mbox series

[-next] net: ena: Remove unused variable 'tx_bytes'

Message ID 20221010031936.2885327-1-chenzhongjin@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [-next] net: ena: Remove unused variable 'tx_bytes' | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: ndesaulniers@google.com trix@redhat.com llvm@lists.linux.dev nathan@kernel.org
netdev/build_clang success Errors and warnings before: 2 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 0 this patch: 0
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

Chen Zhongjin Oct. 10, 2022, 3:19 a.m. UTC
Reported by Clang [-Wunused-but-set-variable]

'commit 548c4940b9f1 ("net: ena: Implement XDP_TX action")'
This commit introduced the variable 'tx_bytes'. However this variable
is never used by other code except iterates itself, so remove it.

Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Shay Agroskin Oct. 2, 2022, 6:35 a.m. UTC | #1
Chen Zhongjin <chenzhongjin@huawei.com> writes:

> CAUTION: This email originated from outside of the 
> organization. Do not click links or open attachments unless you 
> can confirm the sender and know the content is safe.
>
>
>
> Reported by Clang [-Wunused-but-set-variable]
>
> 'commit 548c4940b9f1 ("net: ena: Implement XDP_TX action")'
> This commit introduced the variable 'tx_bytes'. However this 
> variable
> is never used by other code except iterates itself, so remove 
> it.
>
> Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
> ---
>  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 6a356a6cee15..c8dfb9287856 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -1876,7 +1876,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;
> @@ -1914,7 +1913,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;

Nice catch. Thanks

Acked-by: Shay Agroskin <shayagr@amazon.com>
Jakub Kicinski Oct. 3, 2022, 4:42 p.m. UTC | #2
On Mon, 10 Oct 2022 11:19:36 +0800 Chen Zhongjin wrote:
> Reported by Clang [-Wunused-but-set-variable]
> 
> 'commit 548c4940b9f1 ("net: ena: Implement XDP_TX action")'
> This commit introduced the variable 'tx_bytes'. However this variable
> is never used by other code except iterates itself, so remove it.

First of all - please fix the date on your system.

Second:

# Form letter - net-next is closed

Linus has released v6.0, we are currently in a merge window
and therefore net-next is closed for new drivers, features,
code refactoring and optimizations. We are currently accepting
bug fixes only.

Please repost when net-next reopens after 6.1-rc1 is cut.

RFC patches sent for review only are obviously welcome at any time.
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 6a356a6cee15..c8dfb9287856 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1876,7 +1876,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;
@@ -1914,7 +1913,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;