All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Return -1 from get_preempt_count() for unsupported architecture
@ 2026-01-29  5:09 Saket Kumar Bhaskar
  2026-01-29  5:38 ` bot+bpf-ci
  2026-01-29 16:03 ` Yonghong Song
  0 siblings, 2 replies; 4+ messages in thread
From: Saket Kumar Bhaskar @ 2026-01-29  5:09 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, bpf
  Cc: hbathini, sachinpb, venkat88, andrii, eddyz87, ast, daniel,
	martin.lau, song, yonghong.song, john.fastabend, kpsingh, sdf,
	haoluo, jolsa

Make get_preempt_count() to return -1 for unsupported
architectures instead of 0, so callers can distinguish not supported
from a valid preempt_count of 0.

Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
---
 tools/testing/selftests/bpf/bpf_experimental.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h
index 2cd9165c7348..6759d2ae6151 100644
--- a/tools/testing/selftests/bpf/bpf_experimental.h
+++ b/tools/testing/selftests/bpf/bpf_experimental.h
@@ -631,7 +631,7 @@ static inline int get_preempt_count(void)
 #elif defined(bpf_target_arm64)
 	return bpf_get_current_task_btf()->thread_info.preempt.count;
 #endif
-	return 0;
+	return -1;
 }
 
 /* Description
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-29 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29  5:09 [PATCH bpf-next] selftests/bpf: Return -1 from get_preempt_count() for unsupported architecture Saket Kumar Bhaskar
2026-01-29  5:38 ` bot+bpf-ci
2026-01-29 16:03 ` Yonghong Song
2026-01-29 16:13   ` Yonghong Song

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.