From: Chris Gellermann <christian.gellermann@codasip.com>
To: shuah@kernel.org, linux-kselftest@vger.kernel.org
Cc: richard.weiyang@gmail.com, akpm@linux-foundation.org,
reddybalavignesh9979@gmail.com, linux-kernel@vger.kernel.org,
Chris Gellermann <christian.gellermann@codasip.com>
Subject: [PATCH 1/2] selftests/membarrier: Introduce helper to get membarrier command registrations
Date: Mon, 3 Aug 2026 14:48:59 +0200 [thread overview]
Message-ID: <20260803124900.3328789-2-christian.gellermann@codasip.com> (raw)
In-Reply-To: <20260803124900.3328789-1-christian.gellermann@codasip.com>
This allows reusage.
Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com>
---
tools/testing/selftests/membarrier/membarrier_test_impl.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/membarrier/membarrier_test_impl.h b/tools/testing/selftests/membarrier/membarrier_test_impl.h
index f6d7c44b2288..29aac3bc4988 100644
--- a/tools/testing/selftests/membarrier/membarrier_test_impl.h
+++ b/tools/testing/selftests/membarrier/membarrier_test_impl.h
@@ -16,6 +16,11 @@ static int sys_membarrier(int cmd, int flags)
return syscall(__NR_membarrier, cmd, flags);
}
+static int membarrier_get_registrations(void)
+{
+ return sys_membarrier(MEMBARRIER_CMD_GET_REGISTRATIONS, 0);
+}
+
static int test_membarrier_get_registrations(int cmd)
{
int ret, flags = 0;
@@ -24,7 +29,7 @@ static int test_membarrier_get_registrations(int cmd)
registrations |= cmd;
- ret = sys_membarrier(MEMBARRIER_CMD_GET_REGISTRATIONS, 0);
+ ret = membarrier_get_registrations();
if (ret < 0) {
ksft_exit_fail_msg(
"%s test: flags = %d, errno = %d\n",
--
2.47.3
next prev parent reply other threads:[~2026-08-03 12:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 12:48 [PATCH 0/2] selftests/membarrier: Skip an unregistered memory barrier test on Musl Chris Gellermann
2026-08-03 12:48 ` Chris Gellermann [this message]
2026-08-03 12:49 ` [PATCH 2/2] selftests/membarrier: Skip unpermitted membarrier command test if preregistered by libc Chris Gellermann
2026-08-03 20:31 ` Andrew Morton
2026-08-03 20:37 ` Andrew Morton
2026-08-25 19:35 ` Mathieu Desnoyers
2026-08-26 15:56 ` Michael Jeanson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260803124900.3328789-2-christian.gellermann@codasip.com \
--to=christian.gellermann@codasip.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reddybalavignesh9979@gmail.com \
--cc=richard.weiyang@gmail.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.