public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kselftest: futex: Fix memset with zero size warning
@ 2025-11-19  3:00 Wake Liu
  2025-11-19 15:31 ` André Almeida
  2025-11-20 11:59 ` Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: Wake Liu @ 2025-11-19  3:00 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Shuah Khan
  Cc: Peter Zijlstra, Darren Hart, Davidlohr Bueso, André Almeida,
	Wake Liu, linux-kernel, linux-kselftest

The `FIXTURE(args)` macro defines an empty `struct _test_data_args`,
leading to `sizeof(struct _test_data_args)` evaluating to 0. This
caused a build error due to a compiler warning on a `memset` call
with a zero size argument.

Adding a dummy member to the struct ensures its size is non-zero,
resolving the build issue.

Signed-off-by: Wake Liu <wakel@google.com>
---
 tools/testing/selftests/futex/functional/futex_requeue_pi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
index f299d75848cd..000fec468835 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
@@ -52,6 +52,7 @@ struct thread_arg {
 
 FIXTURE(args)
 {
+	char dummy;
 };
 
 FIXTURE_SETUP(args)
-- 
2.52.0.rc1.455.g30608eb744-goog


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

end of thread, other threads:[~2025-12-31 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  3:00 [PATCH] kselftest: futex: Fix memset with zero size warning Wake Liu
2025-11-19 15:31 ` André Almeida
2025-11-20 11:59 ` Thomas Gleixner
2025-12-24  8:41   ` [PATCH] kselftest/harness: Use helper to avoid zero-size memset warning Wake Liu
2025-12-31 20:31     ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox