All of lore.kernel.org
 help / color / mirror / Atom feed
From: jens.korinth@tuta.io
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "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>,
	"Rust For Linux" <rust-for-linux@vger.kernel.org>,
	"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
	"Dirk Behme" <dirk.behme@gmail.com>
Subject: Re: [PATCH v3 1/3] rust: print: Add do_once_lite macro
Date: Sat, 9 Nov 2024 22:33:45 +0100 (CET)	[thread overview]
Message-ID: <OBHnCkU--B-9@tuta.io> (raw)
In-Reply-To: <CANiq72kUAOX5girN+07e+R0OHuwJX_XRJCW0yQPpbBLmaP0wng@mail.gmail.com>



> In addition, the intra-doc link does not really work in commit
> messages :) You probably want to either remove the link, or use an
> actual Link: tag, e.g.
>
> ...to replace `do_once_lite_if` [0] in...
> ...
> Link: https://... [0]
>
Yes, you're right, I also just noticed that the C macro is of course called
`DO_ONCE_LITE_IF`. Will fix this and the rustdoc issues in the next
revision.

> Since we will have `pr_warn_once!` for this, could we perhaps come up
> with another example? i.e. to avoid users thinking that they should
> use it this way.
>
> Also, you could use `assert*!` (possibly hidden, depending on what you
> want the user to see) since it doubles as a test.
>
There aren't many other uses of `DO_ONCE_LITE_IF` in the kernel, that's
why I kept it in `print.rs` and hidden. I didn't quite understand what you
meant with `assert*!` - can you give me an example?

>> +#[doc(hidden)]
>>
>
> Do we want it to be hidden? I guess this could be useful for other
> abstractions etc.
>
> In addition, if we unhide it, should we move it into its own file?
> Just like C has `once_lite.h` etc.
>
Good point, but I'd only do that if it has at least one other use from
somewhere else. I was considering to implement `WARN_*_ONCE`, the
C implementations also use `DO_ONCE_LITE_IF`? But as far as I can tellthere is no implementation of `WARN`, or `__WARN_printf` yet and that
won't be trivial.
Jens

  reply	other threads:[~2024-11-09 21:33 UTC|newest]

Thread overview: 19+ 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
2024-11-09 20:30 ` Jens Korinth via B4 Relay
2024-11-09 20:30 ` [PATCH v3 1/3] rust: print: Add do_once_lite macro Jens Korinth
2024-11-09 20:30   ` Jens Korinth via B4 Relay
2024-11-09 20:41   ` Miguel Ojeda
2024-11-09 21:33     ` jens.korinth [this message]
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
2024-11-09 20:30   ` Jens Korinth via B4 Relay
2024-11-09 20:30 ` [PATCH v3 3/3] rust: error: Replace pr_warn by pr_warn_once Jens Korinth
2024-11-09 20:30   ` Jens Korinth via B4 Relay
2024-11-11  7:05 ` [PATCH v3 0/3] rust: Add pr_*_once macros 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=OBHnCkU--B-9@tuta.io \
    --to=jens.korinth@tuta.io \
    --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=miguel.ojeda.sandonis@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.