diff mbox series

net: alteon: remove unused len variable

Message ID 20230331205545.1863496-1-trix@redhat.com (mailing list archive)
State Accepted
Commit 51aaa68222d6c34f0373cf95223ce2f230329e8f
Delegated to: Netdev Maintainers
Headers show
Series net: alteon: remove unused len variable | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be 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: 19 this patch: 19
netdev/cc_maintainers success CCed 11 of 11 maintainers
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: 19 this patch: 19
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tom Rix March 31, 2023, 8:55 p.m. UTC
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.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/alteon/acenic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Simon Horman April 1, 2023, 9:12 a.m. UTC | #1
On Fri, Mar 31, 2023 at 04:55:45PM -0400, Tom Rix 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.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
patchwork-bot+netdevbpf@kernel.org April 2, 2023, 12:50 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

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!
Jes Sorensen April 2, 2023, 11:43 p.m. UTC | #3
On 3/31/23 16:55, Tom Rix 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.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Signed-off-by: Jes Sorensen <jes@trained-monkey.org>


> ---
>   drivers/net/ethernet/alteon/acenic.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
> index d7762da8b2c0..eafef84fe3be 100644
> --- a/drivers/net/ethernet/alteon/acenic.c
> +++ b/drivers/net/ethernet/alteon/acenic.c
> @@ -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;
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index d7762da8b2c0..eafef84fe3be 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -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;