From: FUJITA Tomonori <tomo@flapping.org>
To: aliceryhl@google.com, ojeda@kernel.org
Cc: tomo@flapping.org, rostedt@goodmis.org, gary@garyguo.net,
a.hindborg@kernel.org, acourbot@nvidia.com,
bjorn3_gh@protonmail.com, boqun@kernel.org, dakr@kernel.org,
daniel.almeida@collabora.com, lossin@kernel.org,
mathieu.desnoyers@efficios.com, mhiramat@kernel.org,
tamird@kernel.org, tmgross@umich.edu, work@onurozkan.dev,
linux-trace-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org, fujita.tomonori@gmail.com
Subject: Re: [PATCH v2] rust: add mark_used macro
Date: Thu, 01 Oct 2026 21:04:03 +0900 (JST) [thread overview]
Message-ID: <20261001.210403.2208685315788982617.tomo@flapping.org> (raw)
In-Reply-To: <ar4-kOdIs7z6zG6k@google.com>
On Thu, 1 Oct 2026 11:05:52 +0000
Alice Ryhl <aliceryhl@google.com> wrote:
> On Wed, Sep 30, 2026 at 06:50:28PM +0900, FUJITA Tomonori wrote:
>> > diff --git a/rust/kernel/tracepoint.rs b/rust/kernel/tracepoint.rs
>> > index c6e80aa99e8e..29d2d2d0aca8 100644
>> > --- a/rust/kernel/tracepoint.rs
>> > +++ b/rust/kernel/tracepoint.rs
>> > @@ -38,9 +38,7 @@ macro_rules! declare_trace {
>> >
>> > #[cfg(not(CONFIG_TRACEPOINTS))]
>> > {
>> > - // If tracepoints are disabled, insert a trivial use of each argument
>> > - // to avoid unused argument warnings.
>> > - $( let _unused = $argname; )*
>> > + $crate::mark_used!($($argname),*);
>> > }
>> > }
>> > )*}
>> >
>>
>> Gentle ping. Could you take a look at the tracepoint.rs part? If it
>> looks fine, I think it is easiest to take the patch through the Rust
>> tree.
>
> Why are we adding this macro?
>
> I think it's better to prefer avoiding macros if we can. The current
> code is familiar to people who know Rust idioms, and now you are
> replacing it with a kernel-specific macro that such people will not be
> familiar with.
The macro was suggested by Miguel:
https://lore.kernel.org/rust-for-linux/CANiq72nWcqd3aSKdPqOSRRQBuwWNW-s2EOscYszQ9kSbmrKxcw@mail.gmail.com/
I think you also have a point.
Miguel, what do you think?
next prev parent reply other threads:[~2026-10-01 12:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 12:02 [PATCH v2] rust: add mark_used macro FUJITA Tomonori
2026-09-30 9:50 ` FUJITA Tomonori
2026-10-01 11:05 ` Alice Ryhl
2026-10-01 12:04 ` FUJITA Tomonori [this message]
2026-10-01 13:02 ` Miguel Ojeda
2026-10-01 21:37 ` FUJITA Tomonori
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=20261001.210403.2208685315788982617.tomo@flapping.org \
--to=tomo@flapping.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=ojeda@kernel.org \
--cc=rostedt@goodmis.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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