mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] selftests: gro: remove unused variable total_data
@ 2026-10-22  3:09 Hangbin Liu
  2026-10-22  7:52 ` Antoine Tenart
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2026-10-22  3:09 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Willem de Bruijn
  Cc: Hangbin Liu, netdev, linux-kselftest, linux-kernel, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

I hit a build warning when building the net selftests.

  gro.c: In function 'check_capacity_pkts':                                                                                                                                                                                     gro.c:1249:13: warning: variable 'total_data' set but not used [-Wunused-but-set-variable=]
   1249 |         int total_data = 0;
        |             ^~~~~~~~~~

Remove the total_data variable, as it is no longer used.

Fixes: d97348474708 ("selftests: drv-net: gro: always wait for FIN in the capacity test")
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 tools/testing/selftests/net/lib/gro.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/testing/selftests/net/lib/gro.c b/tools/testing/selftests/net/lib/gro.c
index 7a333155de1a..1bc92e7a625f 100644
--- a/tools/testing/selftests/net/lib/gro.c
+++ b/tools/testing/selftests/net/lib/gro.c
@@ -1246,7 +1246,6 @@ static void check_capacity_pkts(int fd)
 	int coalesced[num_flows];
 	struct tcphdr *tcph;
 	int ip_ext_len = 0;
-	int total_data = 0;
 	int pkt_size = -1;
 	int data_len = 0;
 	int flow_id;
@@ -1309,7 +1308,6 @@ static void check_capacity_pkts(int fd)
 		}
 
 		num_pkt++;
-		total_data += data_len;
 	}
 
 	/* Check flow ordering. We expect to see all non-coalesced first segs

---
base-commit: e0a958ddfc89f2e1c43448cdaeb5b30e54e19448
change-id: 20261022-self_unused_var-d54af8d61a56

Best regards,
--  
Hangbin Liu <liuhangbin@kylinos.cn>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] selftests: gro: remove unused variable total_data
  2026-10-22  3:09 [PATCH net] selftests: gro: remove unused variable total_data Hangbin Liu
@ 2026-10-22  7:52 ` Antoine Tenart
  2026-10-22 15:23   ` Willem de Bruijn
  0 siblings, 1 reply; 3+ messages in thread
From: Antoine Tenart @ 2026-10-22  7:52 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Willem de Bruijn, netdev,
	linux-kselftest, linux-kernel, Hangbin Liu

On Thu, Oct 22, 2026 at 11:09:35AM +0800, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> I hit a build warning when building the net selftests.
> 
>   gro.c: In function 'check_capacity_pkts':                                                                                                                                                                                     gro.c:1249:13: warning: variable 'total_data' set but not used [-Wunused-but-set-variable=]
>    1249 |         int total_data = 0;
>         |             ^~~~~~~~~~
> 
> Remove the total_data variable, as it is no longer used.
> 
> Fixes: d97348474708 ("selftests: drv-net: gro: always wait for FIN in the capacity test")
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>

Reviewed-by: Antoine Tenart <atenart@kernel.org>

> ---
>  tools/testing/selftests/net/lib/gro.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/lib/gro.c b/tools/testing/selftests/net/lib/gro.c
> index 7a333155de1a..1bc92e7a625f 100644
> --- a/tools/testing/selftests/net/lib/gro.c
> +++ b/tools/testing/selftests/net/lib/gro.c
> @@ -1246,7 +1246,6 @@ static void check_capacity_pkts(int fd)
>  	int coalesced[num_flows];
>  	struct tcphdr *tcph;
>  	int ip_ext_len = 0;
> -	int total_data = 0;
>  	int pkt_size = -1;
>  	int data_len = 0;
>  	int flow_id;
> @@ -1309,7 +1308,6 @@ static void check_capacity_pkts(int fd)
>  		}
>  
>  		num_pkt++;
> -		total_data += data_len;
>  	}
>  
>  	/* Check flow ordering. We expect to see all non-coalesced first segs
> 
> ---
> base-commit: e0a958ddfc89f2e1c43448cdaeb5b30e54e19448
> change-id: 20261022-self_unused_var-d54af8d61a56
> 
> Best regards,
> --  
> Hangbin Liu <liuhangbin@kylinos.cn>
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] selftests: gro: remove unused variable total_data
  2026-10-22  7:52 ` Antoine Tenart
@ 2026-10-22 15:23   ` Willem de Bruijn
  0 siblings, 0 replies; 3+ messages in thread
From: Willem de Bruijn @ 2026-10-22 15:23 UTC (permalink / raw)
  To: Antoine Tenart, Hangbin Liu
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Willem de Bruijn, netdev,
	linux-kselftest, linux-kernel, Hangbin Liu

Antoine Tenart wrote:
> On Thu, Oct 22, 2026 at 11:09:35AM +0800, Hangbin Liu wrote:
> > From: Hangbin Liu <liuhangbin@kylinos.cn>
> > 
> > I hit a build warning when building the net selftests.
> > 
> >   gro.c: In function 'check_capacity_pkts':                                                                                                                                                                                     gro.c:1249:13: warning: variable 'total_data' set but not used [-Wunused-but-set-variable=]
> >    1249 |         int total_data = 0;
> >         |             ^~~~~~~~~~
> > 
> > Remove the total_data variable, as it is no longer used.
> > 
> > Fixes: d97348474708 ("selftests: drv-net: gro: always wait for FIN in the capacity test")
> > Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> Reviewed-by: Antoine Tenart <atenart@kernel.org>

Reviewed-by: Willem de Bruijn <willemb@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-22 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22  3:09 [PATCH net] selftests: gro: remove unused variable total_data Hangbin Liu
2026-10-22  7:52 ` Antoine Tenart
2026-10-22 15:23   ` Willem de Bruijn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®