All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/proc: avoid an ordered comparison of function pointers
@ 2026-12-01 18:08 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-12-01 18:08 UTC (permalink / raw)
  To: Christian Brauner, Shuah Khan
  Cc: Sasha Levin, linux-fsdevel, linux-kselftest, linux-kernel,
	Nathan Chancellor, llvm

ASSERT_NE() finds out whether its arguments are signed with a relational
comparison on their type, which clang flags for function pointers:

  proc-remove-mapped.c:132:2: warning: ordered comparison of function pointers [-Wordered-compare-function-pointers]

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

Fixes: a50a01d799cd ("selftests/proc: check that a mapped entry can be removed")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/proc/proc-remove-mapped.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/proc/proc-remove-mapped.c b/tools/testing/selftests/proc/proc-remove-mapped.c
index ea36fad6087c4..5fecf43ab0288 100644
--- a/tools/testing/selftests/proc/proc-remove-mapped.c
+++ b/tools/testing/selftests/proc/proc-remove-mapped.c
@@ -129,7 +129,7 @@ TEST_F(pci, remove_while_mapped)
 		SKIP(return, "mmap: %s", strerror(errno));
 
 	/* The BAR can be read while the device is there. */
-	ASSERT_NE(signal(SIGBUS, on_sigbus), SIG_ERR);
+	ASSERT_TRUE(signal(SIGBUS, on_sigbus) != SIG_ERR);
 	if (sigsetjmp(fault, 1) == 0) {
 		v = *p;
 	} else {
-- 
2.53.0


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

only message in thread, other threads:[~2026-12-01 18:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 18:08 [PATCH] selftests/proc: avoid an ordered comparison of function pointers Sasha Levin

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.