Commit cc80aa9a authored by Mickaël Salaün's avatar Mickaël Salaün

selftests/harness: Constify fixture variants

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: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240511171445.904356-7-mic@digikod.netSigned-off-by: default avatarMickaël Salaün <mic@digikod.net>
parent 3656bc23
...@@ -338,7 +338,7 @@ static inline pid_t clone3_vfork(void) ...@@ -338,7 +338,7 @@ static inline pid_t clone3_vfork(void)
* variant. * variant.
*/ */
#define FIXTURE_VARIANT_ADD(fixture_name, variant_name) \ #define FIXTURE_VARIANT_ADD(fixture_name, variant_name) \
extern FIXTURE_VARIANT(fixture_name) \ extern const FIXTURE_VARIANT(fixture_name) \
_##fixture_name##_##variant_name##_variant; \ _##fixture_name##_##variant_name##_variant; \
static struct __fixture_variant_metadata \ static struct __fixture_variant_metadata \
_##fixture_name##_##variant_name##_object = \ _##fixture_name##_##variant_name##_object = \
...@@ -350,7 +350,7 @@ static inline pid_t clone3_vfork(void) ...@@ -350,7 +350,7 @@ static inline pid_t clone3_vfork(void)
__register_fixture_variant(&_##fixture_name##_fixture_object, \ __register_fixture_variant(&_##fixture_name##_fixture_object, \
&_##fixture_name##_##variant_name##_object); \ &_##fixture_name##_##variant_name##_object); \
} \ } \
FIXTURE_VARIANT(fixture_name) \ const FIXTURE_VARIANT(fixture_name) \
_##fixture_name##_##variant_name##_variant = _##fixture_name##_##variant_name##_variant =
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment