[PATCH v4 3/3] rust: error: Replace pr_warn by pr_warn_once

From: Jens Korinth via B4 Relay
Date: Tue Nov 26 2024 - 11:41:40 EST


From: Jens Korinth <jens.korinth@xxxxxxx>

Use new pr_warn_once macro to resolve TODO in error.rs.

Signed-off-by: Jens Korinth <jens.korinth@xxxxxxx>
---
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