Skip to contentSkip to conversation

selftests/rseq: avoid an ordered comparison of function pointers

PATCH Applied Sasha Levin 2 participants 2 messages Oct 11 – Nov 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/rseq: avoid an ordered comparison of function pointers

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
---
 tools/testing/selftests/rseq/legacy_check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/legacy_check.c +1 -1
index 3f7de4e283033..b59c4cb874ea1 100644
@@ -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)
Signature · 1 line
2.53.0
merge bot Applied
#1 lore raw

[tip: core/rseq] selftests/rseq: Avoid an ordered comparison of function pointers

The following commit has been merged into the core/rseq branch of tip:

The following commit has been merged into the core/rseq branch of tip:

Commit-ID:     f99b08f3e685e6276ea899a51f00d0d1f2cad4ca
Gitweb:        https://git.kernel.org/tip/f99b08f3e685e6276ea899a51f00d0d1f2cad4ca
Author:        Sasha Levin <[email protected]>
AuthorDate:    Sun, 11 Oct 2026 18:33:36 -04:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 08 Nov 2026 13:41:53 +01:00

selftests/rseq: Avoid an ordered comparison of function pointers

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")
---
 tools/testing/selftests/rseq/legacy_check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/legacy_check.c +1 -1
index 3f7de4e..b59c4cb 100644
@@ -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)