[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240506165518.474504-7-mic@digikod.net>
Date: Mon, 6 May 2024 18:55:14 +0200
From: Mickaël Salaün <mic@...ikod.net>
To: Christian Brauner <brauner@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jakub Kicinski <kuba@...nel.org>,
Kees Cook <keescook@...omium.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>,
Sean Christopherson <seanjc@...gle.com>,
Shengyu Li <shengyu.li.evgeny@...il.com>,
Shuah Khan <shuah@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>
Cc: Mickaël Salaün <mic@...ikod.net>,
Bagas Sanjaya <bagasdotme@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
David Gow <davidgow@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Günther Noack <gnoack@...gle.com>,
Jon Hunter <jonathanh@...dia.com>,
Ron Economos <re@...z.net>,
Ronald Warsow <rwarsow@....de>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Will Drewry <wad@...omium.org>,
kernel test robot <oliver.sang@...el.com>,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
netdev@...r.kernel.org,
stable@...r.kernel.org
Subject: [PATCH v6 06/10] 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@...uxfoundation.org>
Cc: Will Drewry <wad@...omium.org>
Reviewed-by: Kees Cook <keescook@...omium.org>
Signed-off-by: Mickaël Salaün <mic@...ikod.net>
Link: https://lore.kernel.org/r/20240506165518.474504-7-mic@digikod.net
---
Changes since v1:
* Extract change from a bigger patch (suggested by Kees).
---
tools/testing/selftests/kselftest_harness.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 9d7178a71c2c..201040207c85 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -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 =
/**
--
2.45.0
Powered by blists - more mailing lists