]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
selftests/harness: Constify fixture variants
authorMickaël Salaün <mic@digikod.net>
Sat, 11 May 2024 17:14:41 +0000 (19:14 +0200)
committerMickaël Salaün <mic@digikod.net>
Sat, 11 May 2024 17:18:45 +0000 (19:18 +0200)
FIXTURE_VARIANT_ADD() types are passed as const pointers to
FIXTURE_TEARDOWN().  Make that explicit by constifying the variants
declarations.

Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Will Drewry <wad@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240511171445.904356-7-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/kselftest_harness.h

index 9d7178a71c2c093a8f38115471e272422a60d36f..201040207c852d1316d5d1fb508aa4354bc3e0ae 100644 (file)
@@ -338,7 +338,7 @@ static inline pid_t clone3_vfork(void)
  * variant.
  */
 #define FIXTURE_VARIANT_ADD(fixture_name, variant_name) \
-       extern FIXTURE_VARIANT(fixture_name) \
+       extern const FIXTURE_VARIANT(fixture_name) \
                _##fixture_name##_##variant_name##_variant; \
        static struct __fixture_variant_metadata \
                _##fixture_name##_##variant_name##_object = \
@@ -350,7 +350,7 @@ static inline pid_t clone3_vfork(void)
                __register_fixture_variant(&_##fixture_name##_fixture_object, \
                        &_##fixture_name##_##variant_name##_object);    \
        } \
-       FIXTURE_VARIANT(fixture_name) \
+       const FIXTURE_VARIANT(fixture_name) \
                _##fixture_name##_##variant_name##_variant =
 
 /**