🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
4 messages
4 total messages Started by Hangbin Liu Thu, 22 Oct 2026 03:09
[PATCH net] selftests: gro: remove unused variable total_data
#6276
Author: Hangbin Liu
Date: Thu, 22 Oct 2026 03:09
45 lines
9913 bytes
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>
Re: [PATCH net] selftests: gro: remove unused variable total_data
#6320
Author: Antoine Tenart
Date: Thu, 22 Oct 2026 07:52
50 lines
9581 bytes
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>
> 
Re: [PATCH net] selftests: gro: remove unused variable total_data
#6502
Author: Willem de Bruijn
Date: Thu, 22 Oct 2026 15:23
19 lines
12099 bytes
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>
Re: [PATCH net] selftests: gro: remove unused variable total_data
#6943
Author: patchwork-bot+netdevbpf
Date: Fri, 23 Oct 2026 21:10
25 lines
8855 bytes
Hello:

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

On Thu, 22 Oct 2026 11:09:35 +0800 you 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;
>         |             ^~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net] selftests: gro: remove unused variable total_data
    https://git.kernel.org/netdev/net/c/86537a8fb247

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads