All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/tls: Add {} to avoid static checker warning
@ 2021-05-27  3:27 Kees Cook
  2021-06-04 21:34 ` Shuah Khan
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2021-05-27  3:27 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Kees Cook, Dan Carpenter, linux-kernel, linux-kselftest

This silences a static checker warning due to the unusual macro
construction of EXPECT_*() by adding explicit {}s around the enclosing
while loop.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 tools/testing/selftests/net/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index 426d07875a48..7119f8eb823b 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -418,8 +418,9 @@ TEST_F(tls, sendmsg_large)
 		EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
 	}
 
-	while (recvs++ < sends)
+	while (recvs++ < sends) {
 		EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+	}
 
 	free(mem);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests/tls: Add {} to avoid static checker warning
  2021-05-27  3:27 [PATCH] selftests/tls: Add {} to avoid static checker warning Kees Cook
@ 2021-06-04 21:34 ` Shuah Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2021-06-04 21:34 UTC (permalink / raw)
  To: Kees Cook, Shuah Khan
  Cc: Dan Carpenter, linux-kernel, linux-kselftest, Shuah Khan

On 5/26/21 9:27 PM, Kees Cook wrote:
> This silences a static checker warning due to the unusual macro
> construction of EXPECT_*() by adding explicit {}s around the enclosing
> while loop.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>   tools/testing/selftests/net/tls.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
> index 426d07875a48..7119f8eb823b 100644
> --- a/tools/testing/selftests/net/tls.c
> +++ b/tools/testing/selftests/net/tls.c
> @@ -418,8 +418,9 @@ TEST_F(tls, sendmsg_large)
>   		EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
>   	}
>   
> -	while (recvs++ < sends)
> +	while (recvs++ < sends) {
>   		EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
> +	}
>   
>   	free(mem);
>   }
> 

Will pick this up for 5.14

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] selftests/tls: Add {} to avoid static checker warning
@ 2019-01-08 21:41 ` keescook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2019-01-08 21:41 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Dan Carpenter, linux-kernel, linux-kselftest, Dave Watson

This silences a static checker warning due to the unusual macro
construction of EXPECT_*() by adding explicit {}s around the enclosing
while loop.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
I think this will fix it?
---
 tools/testing/selftests/net/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index fac68d710f35..e1472b8b53f3 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large)
 		EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
 	}
 
-	while (recvs++ < sends)
+	while (recvs++ < sends) {
 		EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+	}
 
 	free(mem);
 }
-- 
2.17.1


-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] selftests/tls: Add {} to avoid static checker warning
@ 2019-01-08 21:41 ` keescook
  0 siblings, 0 replies; 5+ messages in thread
From: keescook @ 2019-01-08 21:41 UTC (permalink / raw)


This silences a static checker warning due to the unusual macro
construction of EXPECT_*() by adding explicit {}s around the enclosing
while loop.

Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Kees Cook <keescook at chromium.org>
---
I think this will fix it?
---
 tools/testing/selftests/net/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index fac68d710f35..e1472b8b53f3 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large)
 		EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
 	}
 
-	while (recvs++ < sends)
+	while (recvs++ < sends) {
 		EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+	}
 
 	free(mem);
 }
-- 
2.17.1


-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] selftests/tls: Add {} to avoid static checker warning
@ 2019-01-08 21:41 ` keescook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2019-01-08 21:41 UTC (permalink / raw)


This silences a static checker warning due to the unusual macro
construction of EXPECT_*() by adding explicit {}s around the enclosing
while loop.

Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets")
Signed-off-by: Kees Cook <keescook at chromium.org>
---
I think this will fix it?
---
 tools/testing/selftests/net/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index fac68d710f35..e1472b8b53f3 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large)
 		EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
 	}
 
-	while (recvs++ < sends)
+	while (recvs++ < sends) {
 		EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+	}
 
 	free(mem);
 }
-- 
2.17.1


-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-04 21:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27  3:27 [PATCH] selftests/tls: Add {} to avoid static checker warning Kees Cook
2021-06-04 21:34 ` Shuah Khan
  -- strict thread matches above, loose matches on Subject: below --
2019-01-08 21:41 Kees Cook
2019-01-08 21:41 ` Kees Cook
2019-01-08 21:41 ` keescook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.