rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Korinth via B4 Relay <devnull+jens.korinth.tuta.io@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>
Cc: rust-for-linux@vger.kernel.org,
	 FUJITA Tomonori <fujita.tomonori@gmail.com>,
	 Dirk Behme <dirk.behme@gmail.com>,
	Jens Korinth <jens.korinth@tuta.io>
Subject: [PATCH v3 3/3] rust: error: Replace pr_warn by pr_warn_once
Date: Sat, 09 Nov 2024 21:30:09 +0100	[thread overview]
Message-ID: <20241109-pr_once_macros-v3-3-6beb24e0cac8@tuta.io> (raw)
In-Reply-To: <20241109-pr_once_macros-v3-0-6beb24e0cac8@tuta.io>

From: Jens Korinth <jens.korinth@tuta.io>

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

Signed-off-by: Jens Korinth <jens.korinth@tuta.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 7cd3bbab52f208961390de03a255446950e9eb04..fe1b31506b30fba0ec9d5339d80c2a7fa76ce7c7 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: core::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.44.1



  parent reply	other threads:[~2024-11-09 20:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-09 20:30 [PATCH v3 0/3] rust: Add pr_*_once macros Jens Korinth via B4 Relay
2024-11-09 20:30 ` [PATCH v3 1/3] rust: print: Add do_once_lite macro Jens Korinth via B4 Relay
2024-11-09 20:41   ` Miguel Ojeda
2024-11-09 21:33     ` jens.korinth
2024-11-09 21:44       ` Miguel Ojeda
2024-11-09 22:56   ` Boqun Feng
2024-11-10  7:45     ` jens.korinth
2024-11-10 19:23       ` Boqun Feng
2024-11-11  9:17     ` Alice Ryhl
2024-11-11 13:34       ` jens.korinth
2024-11-11 13:53         ` Alice Ryhl
2024-11-11 17:46           ` Boqun Feng
2024-11-09 20:30 ` [PATCH v3 2/3] rust: print: Add pr_*_once macros Jens Korinth via B4 Relay
2024-11-09 20:30 ` Jens Korinth via B4 Relay [this message]
2024-11-11  7:05 ` [PATCH v3 0/3] rust: " Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241109-pr_once_macros-v3-3-6beb24e0cac8@tuta.io \
    --to=devnull+jens.korinth.tuta.io@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dirk.behme@gmail.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=jens.korinth@tuta.io \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).