Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/harness: Update named initializer syntax

The harness was still using old-style GNU named initializer syntax.
Fix this so Clang will stop warning:

seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
^
./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
fn: &test_name, termsig: _signal }; \
^

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>

authored by

Kees Cook and committed by
Shuah Khan
121e357a 30d53a58

+5 -5
+5 -5
tools/testing/selftests/kselftest_harness.h
··· 168 168 #define __TEST_IMPL(test_name, _signal) \ 169 169 static void test_name(struct __test_metadata *_metadata); \ 170 170 static struct __test_metadata _##test_name##_object = \ 171 - { name: "global." #test_name, \ 172 - fn: &test_name, termsig: _signal }; \ 171 + { .name = "global." #test_name, \ 172 + .fn = &test_name, .termsig = _signal }; \ 173 173 static void __attribute__((constructor)) _register_##test_name(void) \ 174 174 { \ 175 175 __register_test(&_##test_name##_object); \ ··· 304 304 } \ 305 305 static struct __test_metadata \ 306 306 _##fixture_name##_##test_name##_object = { \ 307 - name: #fixture_name "." #test_name, \ 308 - fn: &wrapper_##fixture_name##_##test_name, \ 309 - termsig: signal, \ 307 + .name = #fixture_name "." #test_name, \ 308 + .fn = &wrapper_##fixture_name##_##test_name, \ 309 + .termsig = signal, \ 310 310 }; \ 311 311 static void __attribute__((constructor)) \ 312 312 _register_##fixture_name##_##test_name(void) \