mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/rseq: avoid an ordered comparison of function pointers
@ 2026-10-11 22:33 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-10-11 22:33 UTC (permalink / raw)
  To: Mathieu Desnoyers, Peter Zijlstra, Paul E. McKenney, Boqun Feng,
	Shuah Khan, Nathan Chancellor, Nick Desaulniers, Bill Wendling,
	Justin Stitt, Thomas Gleixner, Dmitry Vyukov
  Cc: Sasha Levin, linux-kernel, linux-kselftest, llvm

ASSERT_NE() compares its arguments with the relational operators when
printing a failure, which clang flags for function pointers:

  legacy_check.c:41:2: warning: ordered comparison of function pointers [-Wordered-compare-function-pointers]

Check the result of signal() with ASSERT_TRUE() instead.

Fixes: fdf4eb632683b ("selftests/rseq: Validate legacy behavior")
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/rseq/legacy_check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/rseq/legacy_check.c b/tools/testing/selftests/rseq/legacy_check.c
index 3f7de4e283033..b59c4cb874ea1 100644
--- a/tools/testing/selftests/rseq/legacy_check.c
+++ b/tools/testing/selftests/rseq/legacy_check.c
@@ -38,7 +38,7 @@ FIXTURE_SETUP(legacy)
 		ASSERT_EQ(res, 0);
 	}
 
-	ASSERT_NE(signal(SIGUSR1, sigfn), SIG_ERR);
+	ASSERT_TRUE(signal(SIGUSR1, sigfn) != SIG_ERR);
 }
 
 FIXTURE_TEARDOWN(legacy)
-- 
2.53.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-11 22:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 22:33 [PATCH] selftests/rseq: avoid an ordered comparison of function pointers Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®