Skip to content

Commit

Permalink
selftests: net: tls: remove unused variable and code
Browse files Browse the repository at this point in the history
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.

Fixes: 7f657d5 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Anders Roxell <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
roxell authored and davem330 committed Nov 7, 2021
1 parent e1464db commit 62b12ab
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tools/testing/selftests/net/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand Down

0 comments on commit 62b12ab

Please sign in to comment.