selftests: net: tls: remove unused variable and code
Subsystems (4)
PATCH 1/1 selftests: net: tls: remove unused variable and code
When building selftests/net with clang, the compiler warn about the function abs() see below:
tls.c:657:15: warning: variable 'len_compared' set but not used [-Wunused-but-set-variable]
unsigned int len_compared = 0;
^Rework to remove the unused variable and the for-loop where the variable 'len_compared' was assinged.
--- tools/testing/selftests/net/tls.c | 3 --- 1 file changed, 3 deletions(-)
tools/testing/selftests/net/tls.c +0 -3
@@ -654,7 +654,6 @@ TEST_F(tls, recvmsg_single_max) TEST_F(tls, recvmsg_multiple) {unsigned int msg_iovlen =1024 ; -unsigned int len_compared =0 ;struct iovec vec[1024 ];char *iov_base[1024 ];unsigned int iov_len =16 ;
@@ -675,8 +674,6 @@ TEST_F(tls, recvmsg_multiple) hdr.msg_iovlen = msg_iovlen; hdr.msg_iov = vec;EXPECT_NE (recvmsg (self->cfd, &hdr,0 ),-1 ); -for (i =0 ; i < msg_iovlen; i++) - len_compared += iov_len;for (i =0 ; i < msg_iovlen; i++)free (iov_base[i]);
Signature · 1 line
2.33.0
Quoted 4 lines · Anders Roxell
When building selftests/net with clang, the compiler warn about the function
abs()see below:
Quoted 8 lines
tls.c:657:15: warning: variable '
len_compared' set but not used [-Wunused-but-set-variable]unsigned int len_compared = 0; ^Rework to remove the unused variable and the for-loop where the variable '
len_compared' was assinged.Signed-off-by Anders Roxell <[email protected]>
Thanks for the patch. Hard to say what the original intent was here.
Quoted 28 lines
--- tools/testing/selftests/net/tls.c | 3 --- 1 file changed, 3 deletions(-)tools/testing/selftests/net/tls.c +0
-4@@ -654,7 +654,6 @@ TEST_F(tls, recvmsg_single_max) TEST_F(tls, recvmsg_multiple) {unsigned int msg_iovlen =1024 ; -unsigned int len_compared =0 ;struct iovec vec[1024 ];char *iov_base[1024 ];unsigned int iov_len =16 ;@@ -675,8 +674,6 @@ TEST_F(tls, recvmsg_multiple) hdr.msg_iovlen = msg_iovlen; hdr.msg_iov = vec;EXPECT_NE (recvmsg (self->cfd, &hdr,0 ),-1 ); -for (i =0 ; i < msg_iovlen; i++) - len_compared += iov_len;for (i =0 ; i < msg_iovlen; i++)free (iov_base[i]); --2.33.0
Signature · 2 lines
Thanks, ~Nick Desaulniers
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Fri, 5 Nov 2021 17:45:11 +0100 you wrote:
When building selftests/net with clang, the compiler warn about the function
abs()see below:tls.c:657:15: warning: variable '
len_compared' set but not used [-Wunused-but-set-variable]unsigned int len_compared = 0; ^[...]
Here is the summary with links:
- selftests: net: tls: remove unused variable and code
https://git.kernel.org/netdev/net/c/62b12ab5dff0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html