[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250304-nolibc-kselftest-harness-v1-7-adca7cd231e2@linutronix.de>
Date: Tue, 04 Mar 2025 08:10:37 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Shuah Khan <shuah@...nel.org>, Shuah Khan <skhan@...uxfoundation.org>,
Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 07/32] selftests: harness: Remove dependency on libatomic
__sync_bool_compare_and_swap() is deprecated and requires libatomic on
GCC. Compiler toolchains don't necessarily have libatomic available, so
avoid this requirement by using atomics that don't need libatomic.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
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 6659c10f4d8fc7c750bc5e8a36ebcbcacda5de60..bf5ffc594a4a864d2e8bb6f47c29fa56d58919d9 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -443,12 +443,12 @@
} \
if (child == 0) { \
if (_metadata->setup_completed && !fixture_name##_teardown_parent && \
- __sync_bool_compare_and_swap(teardown, false, true)) \
+ !__atomic_test_and_set(teardown, __ATOMIC_RELAXED)) \
fixture_name##_teardown(_metadata, self, variant->data); \
_exit(0); \
} \
if (_metadata->setup_completed && fixture_name##_teardown_parent && \
- __sync_bool_compare_and_swap(teardown, false, true)) \
+ !__atomic_test_and_set(teardown, __ATOMIC_RELAXED)) \
fixture_name##_teardown(_metadata, self, variant->data); \
munmap(teardown, sizeof(*teardown)); \
if (self && fixture_name##_teardown_parent) \
--
2.48.1
Powered by blists - more mailing lists