selftests/net: fix typo in tcp_mmap
Subsystems (3)
PATCH 1/1 selftests/net: fix typo in tcp_mmap
kernel test robot reported the following warning:
All warnings (new ones prefixed by >>):
tcp_mmap.c: In function 'child_thread':
Quoted 1 line
Quoted 1 line
tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function [-Wmaybe-uninitialized]
211 | zc.length = min(chunk_size, FILE_SZ - lu);
We want to read FILE_SZ bytes, so the correct expression should be (FILE_SZ - total)
--- tools/testing/selftests/net/tcp_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/tcp_mmap.c +1 -1
@@ -208,7 +208,7 @@ void *child_thread(void *arg)memset (&zc,0 ,sizeof (zc)); zc.address = (__u64)((unsigned long )addr); - zc.length =min (chunk_size,FILE_SZ - lu); + zc.length =min (chunk_size,FILE_SZ - total); res =getsockopt (fd,IPPROTO_TCP ,TCP_ZEROCOPY_RECEIVE , &zc, &zc_len);
Signature · 1 line
2.40.0.348.gf938b09366-goog
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Wed, 5 Apr 2023 07:15:56 +0000 you wrote:
kernel test robot reported the following warning:
All warnings (new ones prefixed by >>):
tcp_mmap.c: In function 'child_thread':Quoted 1 line
Quoted 1 line
tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function [-Wmaybe-uninitialized]
211 | zc.length = min(chunk_size, FILE_SZ - lu);[...]
Here is the summary with links:
- [net-next] selftests/net: fix typo in tcp_mmap
https://git.kernel.org/netdev/net-next/c/905a9eb5f636
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html