File 0001-lkl-tests-drop-unused-lkl_test.fn-parameters.patch of Package lkl

From a3ed0bd3e48526b90ab9f5a63b09d1ed67376582 Mon Sep 17 00:00:00 2001
From: David Disseldorp <ddiss@suse.de>
Date: Thu, 26 Jun 2025 15:56:27 +1000
Subject: [PATCH] lkl: tests: drop unused lkl_test.fn() parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The existing t.fn(t->arg1, t->arg2, t->arg3) call can lead to build
failures:
  tests/test.c: In function ‘lkl_test_run’:
  tests/test.c:93:23: error: too many arguments to function ‘t->fn’;
                             expected 0, have 3

The parameters don't appear to be used, so can be removed.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 tools/lkl/tests/test.c | 2 +-
 tools/lkl/tests/test.h | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/lkl/tests/test.c b/tools/lkl/tests/test.c
index 38784ab4ad140..1ff6abeac82eb 100644
--- a/tools/lkl/tests/test.c
+++ b/tools/lkl/tests/test.c
@@ -90,7 +90,7 @@ int lkl_test_run(const struct lkl_test *tests, int nr, const char *fmt, ...)
 
 		start = clock();
 
-		ret = t->fn(t->arg1, t->arg2, t->arg3);
+		ret = t->fn();
 
 		stop = clock();
 
diff --git a/tools/lkl/tests/test.h b/tools/lkl/tests/test.h
index 653a967df0660..e772d9c47d1bd 100644
--- a/tools/lkl/tests/test.h
+++ b/tools/lkl/tests/test.h
@@ -9,16 +9,14 @@
 
 struct lkl_test {
 	const char *name;
-	int (*fn)();
-	void *arg1, *arg2, *arg3;
+	int (*fn)(void);
 };
 
 /**
  * Simple wrapper to initialize a test entry.
- * @name - test name, it assume test function is named test_@name
- * @vargs - arguments to be passed to the function
+ * @name - test name; assume existing test function named lkl_test_@name
  */
-#define LKL_TEST(name, ...) { #name, lkl_test_##name, __VA_ARGS__ }
+#define LKL_TEST(name) { #name, lkl_test_##name }
 
 /**
  * lkl_test_run - run a test suite
-- 
2.43.0

openSUSE Build Service is sponsored by