[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241126-pr_once_macros-v4-3-410b8ca9643e@tuta.io>
Date: Tue, 26 Nov 2024 17:40:59 +0100
From: Jens Korinth via B4 Relay <devnull+jens.korinth.tuta.io@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>
Cc: rust-for-linux@...r.kernel.org,
FUJITA Tomonori <fujita.tomonori@...il.com>,
Dirk Behme <dirk.behme@...il.com>, linux-kernel@...r.kernel.org,
Jens Korinth <jens.korinth@...a.io>
Subject: [PATCH v4 3/3] rust: error: Replace pr_warn by pr_warn_once
From: Jens Korinth <jens.korinth@...a.io>
Use new pr_warn_once macro to resolve TODO in error.rs.
Signed-off-by: Jens Korinth <jens.korinth@...a.io>
---
rust/kernel/error.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 52c5024324474fc1306047f3fd7516f0023d0313..f6813dace1128b7ef91f64e79cd83bb64995bf97 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -102,8 +102,7 @@ impl Error {
/// be returned in such a case.
pub fn from_errno(errno: crate::ffi::c_int) -> Error {
if errno < -(bindings::MAX_ERRNO as i32) || errno >= 0 {
- // TODO: Make it a `WARN_ONCE` once available.
- crate::pr_warn!(
+ crate::pr_warn_once!(
"attempted to create `Error` with out of range `errno`: {}",
errno
);
--
2.47.0
Powered by blists - more mailing lists