[PATCH] selftests: vDSO: quash clang omitted parameter warning in getrandom test

Jason A. Donenfeld posted 1 patch 1 year, 3 months ago
tools/testing/selftests/vDSO/vdso_test_getrandom.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] selftests: vDSO: quash clang omitted parameter warning in getrandom test
Posted by Jason A. Donenfeld 1 year, 3 months ago
When building with clang, there's this warning:

vdso_test_getrandom.c:145:40: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
  145 | static void *test_vdso_getrandom(void *)
      |                                        ^
vdso_test_getrandom.c:155:40: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
  155 | static void *test_libc_getrandom(void *)
      |                                        ^
vdso_test_getrandom.c:165:43: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
  165 | static void *test_syscall_getrandom(void *)

Add the named ctx parameter to quash it.

Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
This will go in random.git alongside the stack of other fixes to this
area.

 tools/testing/selftests/vDSO/vdso_test_getrandom.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
index 351daeb649c8..8866b65a4605 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
@@ -143,7 +143,7 @@ static ssize_t vgetrandom(void *buf, size_t len, unsigned long flags)
 
 enum { TRIALS = 25000000, THREADS = 256 };
 
-static void *test_vdso_getrandom(void *)
+static void *test_vdso_getrandom(void *ctx)
 {
 	for (size_t i = 0; i < TRIALS; ++i) {
 		unsigned int val;
@@ -153,7 +153,7 @@ static void *test_vdso_getrandom(void *)
 	return NULL;
 }
 
-static void *test_libc_getrandom(void *)
+static void *test_libc_getrandom(void *ctx)
 {
 	for (size_t i = 0; i < TRIALS; ++i) {
 		unsigned int val;
@@ -163,7 +163,7 @@ static void *test_libc_getrandom(void *)
 	return NULL;
 }
 
-static void *test_syscall_getrandom(void *)
+static void *test_syscall_getrandom(void *ctx)
 {
 	for (size_t i = 0; i < TRIALS; ++i) {
 		unsigned int val;
-- 
2.46.0
Re: [PATCH] selftests: vDSO: quash clang omitted parameter warning in getrandom test
Posted by Mark Brown 1 year, 3 months ago
On Fri, Aug 30, 2024 at 05:23:52PM +0200, Jason A. Donenfeld wrote:
> When building with clang, there's this warning:
> 
> vdso_test_getrandom.c:145:40: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
>   145 | static void *test_vdso_getrandom(void *)

> Add the named ctx parameter to quash it.

Reviewed-by: Mark Brown <broonie@kernel.org>