* [PATCH net] selftests/net: tcp_mmap: remove unused -k option and keepflag
@ 2026-10-21 15:26 Greg Thelen
2026-10-21 16:12 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Greg Thelen @ 2026-10-21 15:26 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Soheil Hassas Yeganeh, netdev, linux-kselftest, linux-kernel,
llvm, Greg Thelen
Commit aacb0c2e524c ("selftests: net: tcp_mmap must use
TCP_ZEROCOPY_RECEIVE") removed the only read of keepflag in child_thread(),
leaving the file-scope keepflag variable set by the -k option in main() but
never read. This triggers a Clang 23 warning:
tcp_mmap.c:91:12: error: variable 'keepflag' set but not used
[-Werror,-Wunused-but-set-global]
Remove the unused keepflag variable and the dead -k getopt option.
Fixes: aacb0c2e524c ("selftests: net: tcp_mmap must use TCP_ZEROCOPY_RECEIVE")
Signed-off-by: Greg Thelen <gthelen@google.com>
---
tools/testing/selftests/net/tcp_mmap.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c
index 487ae659a1f1..86241bed7f08 100644
--- a/tools/testing/selftests/net/tcp_mmap.c
+++ b/tools/testing/selftests/net/tcp_mmap.c
@@ -85,7 +85,6 @@ static int rcvbuf; /* Default: autotuning. Can be set with -r <integer> option
static int sndbuf; /* Default: autotuning. Can be set with -w <integer> option */
static int zflg; /* zero copy option. (MSG_ZEROCOPY for sender, mmap() for receiver */
static int xflg; /* hash received data (simple xor) (-h option) */
-static int keepflag; /* -k option: receiver shall keep all received file in memory (no munmap() calls) */
static int integrity; /* -i option: sender and receiver compute sha256 over the data.*/
static size_t chunk_size = 512*1024;
@@ -456,7 +455,7 @@ int main(int argc, char *argv[])
int sflg = 0;
int mss = 0;
- while ((c = getopt(argc, argv, "46p:svr:w:H:zxkP:M:C:a:i")) != -1) {
+ while ((c = getopt(argc, argv, "46p:svr:w:H:zxP:M:C:a:i")) != -1) {
switch (c) {
case '4':
cfg_family = PF_INET;
@@ -490,9 +489,6 @@ int main(int argc, char *argv[])
case 'x':
xflg = 1;
break;
- case 'k':
- keepflag = 1;
- break;
case 'P':
max_pacing_rate = atoi(optarg) ;
break;
--
2.56.0.212.g129ede20d9-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] selftests/net: tcp_mmap: remove unused -k option and keepflag
2026-10-21 15:26 [PATCH net] selftests/net: tcp_mmap: remove unused -k option and keepflag Greg Thelen
@ 2026-10-21 16:12 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2026-10-21 16:12 UTC (permalink / raw)
To: Greg Thelen
Cc: David S. Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Shuah Khan, Soheil Hassas Yeganeh, netdev, linux-kselftest,
linux-kernel, llvm
Le mer. 21 oct. 2026 à 17:27, Greg Thelen <gthelen@google.com> a écrit :
>
> Commit aacb0c2e524c ("selftests: net: tcp_mmap must use
> TCP_ZEROCOPY_RECEIVE") removed the only read of keepflag in child_thread(),
> leaving the file-scope keepflag variable set by the -k option in main() but
> never read. This triggers a Clang 23 warning:
>
> tcp_mmap.c:91:12: error: variable 'keepflag' set but not used
> [-Werror,-Wunused-but-set-global]
>
> Remove the unused keepflag variable and the dead -k getopt option.
>
> Fixes: aacb0c2e524c ("selftests: net: tcp_mmap must use TCP_ZEROCOPY_RECEIVE")
> Signed-off-by: Greg Thelen <gthelen@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-21 16:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21 15:26 [PATCH net] selftests/net: tcp_mmap: remove unused -k option and keepflag Greg Thelen
2026-10-21 16:12 ` Eric Dumazet
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®