Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] rust: bug: support WARN_ON_ONCE()
@ 2026-12-02  1:01 FUJITA Tomonori
  2026-12-02  1:01 ` [PATCH v2 1/2] rust: bug: make warn_flags! take a once flag FUJITA Tomonori
  2026-12-02  1:01 ` [PATCH v2 2/2] rust: bug: add warn_on_once! FUJITA Tomonori
  0 siblings, 2 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2026-12-02  1:01 UTC (permalink / raw)
  To: aliceryhl, ojeda
  Cc: a.hindborg, acourbot, bjorn3_gh, boqun, dakr, daniel.almeida,
	gary, lossin, mbkchelofficialdev, tamird, tmgross, work,
	rust-for-linux, FUJITA Tomonori

From: FUJITA Tomonori <fujita.tomonori@gmail.com>

This series adds warn_on_once!, the Rust version of C WARN_ON_ONCE().
Alice asked for it for the TODO in VmaRef::zap_vma_range() [1].

Patch 1 makes warn_flags! take a once flag. Patch 2 adds warn_on_once!
and a KUnit test.

Ran the KUnit test on x86_64, UML, ARM and LoongArch.

[1] https://lore.kernel.org/r/20261130141543.3699023-1-aliceryhl@google.com

v2:
- Select the once path at macro expansion time instead of a runtime branch
  (Gary)
- Explain why a WARN_ON_ONCE() C helper does not work (Gary)
v1: https://lore.kernel.org/all/20261130230914.739923-1-tomo@flapping.org/

FUJITA Tomonori (2):
  rust: bug: make warn_flags! take a once flag
  rust: bug: add warn_on_once!

 rust/kernel/bug.rs | 92 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 72 insertions(+), 20 deletions(-)


base-commit: 82d8023ec40420ed61d7a96a173ef862741f1753
-- 
2.43.0


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

end of thread, other threads:[~2026-12-02  1:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  1:01 [PATCH v2 0/2] rust: bug: support WARN_ON_ONCE() FUJITA Tomonori
2026-12-02  1:01 ` [PATCH v2 1/2] rust: bug: make warn_flags! take a once flag FUJITA Tomonori
2026-12-02  1:01 ` [PATCH v2 2/2] rust: bug: add warn_on_once! FUJITA Tomonori

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