Skip to content

Commit 6c409e0

Browse files
committed
selftests: harness: Ignore unused variant argument warning
For tests without fixtures the variant argument is unused. This is intentional, prevent to compiler from complaining. Example warning: harness-selftest.c: In function 'wrapper_standalone_pass': ../kselftest_harness.h:181:52: error: unused parameter 'variant' [-Werror=unused-parameter] 181 | struct __fixture_variant_metadata *variant) \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../kselftest_harness.h:156:25: note: in expansion of macro '__TEST_IMPL' 156 | #define TEST(test_name) __TEST_IMPL(test_name, -1) | ^~~~~~~~~~~ harness-selftest.c:15:1: note: in expansion of macro 'TEST' 15 | TEST(standalone_pass) { | ^~~~ Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Muhammad Usama Anjum <[email protected]> Acked-by: Shuah Khan <[email protected]> Link: https://lore.kernel.org/r/20250505-nolibc-kselftest-harness-v4-3-ee4dd5257135@linutronix.de Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 575eca2 commit 6c409e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kselftest_harness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
static void test_name(struct __test_metadata *_metadata); \
175175
static inline void wrapper_##test_name( \
176176
struct __test_metadata *_metadata, \
177-
struct __fixture_variant_metadata *variant) \
177+
struct __fixture_variant_metadata __attribute__((unused)) *variant) \
178178
{ \
179179
_metadata->setup_completed = true; \
180180
if (setjmp(_metadata->env) == 0) \

0 commit comments

Comments
 (0)