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 v2 3/3] rust: error: Replace pr_warn by pr_warn_once
Date: Thu, 07 Nov 2024 00:28:33 +0100	[thread overview]
Message-ID: <20241107-pr_once_macros-v2-3-dc0317ff301e@tuta.io> (raw)
In-Reply-To: <20241107-pr_once_macros-v2-0-dc0317ff301e@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-06 23:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 23:28 [PATCH v2 0/3] rust: Add pr_*_once macros Jens Korinth via B4 Relay
2024-11-06 23:28 ` [PATCH v2 1/3] rust: print: Add do_once_lite macro Jens Korinth via B4 Relay
2024-11-06 23:28 ` [PATCH v2 2/3] rust: print: Add pr_*_once macros Jens Korinth via B4 Relay
2024-11-07 11:14   ` Miguel Ojeda
2024-11-08 12:09     ` FUJITA Tomonori
2024-11-08 20:10     ` jens.korinth
2024-11-08 20:25       ` Miguel Ojeda
2024-11-07 14:29   ` kernel test robot
2024-11-08 12:21   ` Dirk Behme
2024-11-06 23:28 ` Jens Korinth via B4 Relay [this message]

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=20241107-pr_once_macros-v2-3-dc0317ff301e@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).