From: kernel test robot <[email protected]>
Date: Tue, 28 Oct 2025 09:59:29 +0800
> Hi Kuniyuki,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on shuah-kselftest/next]
> [also build test WARNING on shuah-kselftest/fixes kees/for-next/seccomp
> linus/master v6.18-rc2 next-20251024]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:
> https://github.com/intel-lab-lkp/linux/commits/Kuniyuki-Iwashima/selftests-harness-Support-KCOV/20251017-164507
> base:
> https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
> patch link:
> https://lore.kernel.org/r/20251017084022.3721950-1-kuniyu%40google.com
> patch subject: [PATCH] selftests: harness: Support KCOV.
> :::::: branch date: 9 days ago
> :::::: commit date: 9 days ago
> config: x86_64-allnoconfig-bpf
> (https://download.01.org/0day-ci/archive/20251026/[email protected]/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20251026/[email protected]/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version
> of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <[email protected]>
> | Closes: https://lore.kernel.org/r/[email protected]/
>
> All warnings (new ones prefixed by >>):
>
> In file included from listmount_test.c:14:
> ../../kselftest_harness.h:188:25: error: initialization of 'void
> (*)(struct __test_metadata *, struct __fixture_variant_metadata *, char *)'
> from incompatible pointer type 'void (*)(struct __test_metadata *, struct
> __fixture_variant_metadata *)' [-Wincompatible-pointer-types]
> 188 | .fn = &wrapper_##test_name, \
> | ^
> ../../kselftest_harness.h:157:25: note: in expansion of macro '__TEST_IMPL'
> 157 | #define TEST(test_name) __TEST_IMPL(test_name, -1)
> | ^~~~~~~~~~~
> listmount_test.c:23:1: note: in expansion of macro 'TEST'
> 23 | TEST(listmount_forward)
> | ^~~~
Oh sorry, I missed TEST() as af_unix didn't use it,
but I should've compiled all tests.
Will squash this diff to v2.
Thanks!
---8<---
diff --git a/tools/testing/selftests/kselftest_harness.h
b/tools/testing/selftests/kselftest_harness.h
index cba8020853b5..5b7a01722981 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -179,9 +179,12 @@
static void test_name(struct __test_metadata *_metadata); \
static void wrapper_##test_name( \
struct __test_metadata *_metadata, \
- struct __fixture_variant_metadata __attribute__((unused))
*variant) \
+ struct __fixture_variant_metadata __attribute__((unused))
*variant, \
+ char *test_full_name) \
{ \
+ enable_kcov(_metadata); \
test_name(_metadata); \
+ disable_kcov(_metadata, test_full_name); \
} \
static struct __test_metadata _##test_name##_object = \
{ .name = #test_name, \
---8<---