diff mbox series

[net,v4,1/4] selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning

Message ID 20230201001612.515730-1-andrei.gherzan@canonical.com (mailing list archive)
State Accepted
Commit c03c80e3a03ffb4f790901d60797e9810539d946
Headers show
Series [net,v4,1/4] selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning | expand

Commit Message

Andrei Gherzan Feb. 1, 2023, 12:16 a.m. UTC
This change fixes the following compiler warning:

/usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘gso_size’ may
be used uninitialized [-Wmaybe-uninitialized]
   40 |     __error_noreturn (__status, __errnum, __format,
   __va_arg_pack ());
         |
	 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	 udpgso_bench_rx.c: In function ‘main’:
	 udpgso_bench_rx.c:253:23: note: ‘gso_size’ was declared here
	   253 |         int ret, len, gso_size, budget = 256;

Fixes: 3327a9c46352 ("selftests: add functionals test for UDP GRO")
Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
---
 tools/testing/selftests/net/udpgso_bench_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Willem de Bruijn Feb. 1, 2023, 2:55 p.m. UTC | #1
On Tue, Jan 31, 2023 at 7:18 PM Andrei Gherzan
<andrei.gherzan@canonical.com> wrote:
>
> This change fixes the following compiler warning:
>
> /usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘gso_size’ may
> be used uninitialized [-Wmaybe-uninitialized]
>    40 |     __error_noreturn (__status, __errnum, __format,
>    __va_arg_pack ());
>          |
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>          udpgso_bench_rx.c: In function ‘main’:
>          udpgso_bench_rx.c:253:23: note: ‘gso_size’ was declared here
>            253 |         int ret, len, gso_size, budget = 256;
>
> Fixes: 3327a9c46352 ("selftests: add functionals test for UDP GRO")
> Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>
patchwork-bot+netdevbpf@kernel.org Feb. 2, 2023, 12:40 p.m. UTC | #2
Hello:

This series was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Wed,  1 Feb 2023 00:16:10 +0000 you wrote:
> This change fixes the following compiler warning:
> 
> /usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘gso_size’ may
> be used uninitialized [-Wmaybe-uninitialized]
>    40 |     __error_noreturn (__status, __errnum, __format,
>    __va_arg_pack ());
>          |
> 	 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 	 udpgso_bench_rx.c: In function ‘main’:
> 	 udpgso_bench_rx.c:253:23: note: ‘gso_size’ was declared here
> 	   253 |         int ret, len, gso_size, budget = 256;
> 
> [...]

Here is the summary with links:
  - [net,v4,1/4] selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning
    https://git.kernel.org/netdev/net/c/c03c80e3a03f
  - [net,v4,2/4] selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided
    https://git.kernel.org/netdev/net/c/db9b47ee9f5f
  - [net,v4,3/4] selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs
    https://git.kernel.org/netdev/net/c/dafe93b9ee21
  - [net,v4,4/4] selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking
    https://git.kernel.org/netdev/net/c/329c9cd769c2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/udpgso_bench_rx.c b/tools/testing/selftests/net/udpgso_bench_rx.c
index 6a193425c367..d0895bd1933f 100644
--- a/tools/testing/selftests/net/udpgso_bench_rx.c
+++ b/tools/testing/selftests/net/udpgso_bench_rx.c
@@ -250,7 +250,7 @@  static int recv_msg(int fd, char *buf, int len, int *gso_size)
 static void do_flush_udp(int fd)
 {
 	static char rbuf[ETH_MAX_MTU];
-	int ret, len, gso_size, budget = 256;
+	int ret, len, gso_size = 0, budget = 256;
 
 	len = cfg_read_all ? sizeof(rbuf) : 0;
 	while (budget--) {