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 0/3] rust: Add pr_*_once macros
Date: Thu, 07 Nov 2024 00:28:30 +0100	[thread overview]
Message-ID: <20241107-pr_once_macros-v2-0-dc0317ff301e@tuta.io> (raw)

Add Rust version of pr_[emerg|alert|crit|err|warn|notic|info]_once
functions, which print a message only once.

v2:
- Split patch into do_once_lite part and pr_*_once macros
- Add macro rule for call without condition => renamed to do_once_lite
- Used condition-less call in pr_*_once macros
- Added examples
- Removed TODO in kernel/error.rs using pr_warn_once
v1: https://lore.kernel.org/rust-for-linux/20241106.083113.356536037967804464.fujita.tomonori@gmail.com/

Signed-off-by: Jens Korinth <jens.korinth@tuta.io>
Co-developed-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Co-developed-by: Boqun Feng <boqun.feng@gmail.com>
---
FUJITA Tomonori (1):
      rust: print: Add pr_*_once macros

Jens Korinth (2):
      rust: print: Add do_once_lite macro
      rust: error: Replace pr_warn by pr_warn_once

 rust/kernel/error.rs |   3 +-
 rust/kernel/print.rs | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+), 2 deletions(-)
---
base-commit: ae7851c29747fa3765ecb722fe722117a346f988
change-id: 20241107-pr_once_macros-6438e6f5b923

Best regards,
-- 
Jens Korinth <jens.korinth@tuta.io>



             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 Jens Korinth via B4 Relay [this message]
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 ` [PATCH v2 3/3] rust: error: Replace pr_warn by pr_warn_once Jens Korinth via B4 Relay

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-0-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).