From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Gary Guo" <gary@kernel.org>
Cc: "Gary Guo" <gary@garyguo.net>, "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Abdiel Janulgue" <abdiel.janulgue@gmail.com>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Robin Murphy" <robin.murphy@arm.com>,
"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
"Yury Norov" <yury.norov@gmail.com>,
"Will Deacon" <will@kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Waiman Long" <longman@redhat.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Yury Norov" <ynorov@nvidia.com>,
rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
driver-core@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH v3 4/4] rust: make `build_assert` module the home of related macros
Date: Sat, 21 Mar 2026 22:05:22 +0900 [thread overview]
Message-ID: <DH8HDA6Q6FU3.3JR57W97IO1VE@nvidia.com> (raw)
In-Reply-To: <20260319121653.2975748-5-gary@kernel.org>
On Thu Mar 19, 2026 at 9:16 PM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Given the macro scoping rules, all macros are rendered 3 times, in the
> module, in the top-level of kernel crate, and in the prelude.
>
> Add `#[doc(no_inline)]` to the prelude so it just shows up as re-export.
> Add `#[doc(hidden)]` to the macro definition and `#[doc(inline)]` to the
> re-export inside `build_assert` module so the top-level items are hidden.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> drivers/gpu/nova-core/bitfield.rs | 4 ++--
> drivers/gpu/nova-core/num.rs | 2 +-
> rust/kernel/build_assert.rs | 19 ++++++++++++-------
> rust/kernel/dma.rs | 5 +++--
> rust/kernel/io/register.rs | 19 ++++++++++++-------
> rust/kernel/io/resource.rs | 2 +-
> rust/kernel/ioctl.rs | 2 +-
> rust/kernel/net/phy/reg.rs | 8 +++++---
> rust/kernel/num/bounded.rs | 2 +-
> rust/kernel/prelude.rs | 3 ++-
> rust/kernel/sync/atomic/internal.rs | 9 ++++++---
> rust/kernel/sync/atomic/predefine.rs | 2 +-
> rust/kernel/sync/locked_by.rs | 2 +-
> rust/kernel/sync/refcount.rs | 8 +++++---
> rust/kernel/xarray.rs | 10 ++++++++--
> 15 files changed, 61 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs
> index 16e143658c51..c3e1235ad7fb 100644
> --- a/drivers/gpu/nova-core/bitfield.rs
> +++ b/drivers/gpu/nova-core/bitfield.rs
> @@ -170,7 +170,7 @@ impl $name {
> (@check_field_bounds $hi:tt:$lo:tt $field:ident as bool) => {
> #[allow(clippy::eq_op)]
> const _: () = {
> - ::kernel::build_assert!(
> + ::kernel::build_assert::build_assert!(
Given that the `build_assert` module now hosts 3 different assert
macros, have we considered renaming it to just `assert`? Otherwise the
naming implies that it is more connected to the `build_assert` macro
than the others, which doesn't seem to be true.
WARNING: multiple messages have this Message-ID (diff)
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Gary Guo" <gary@kernel.org>
Cc: "Gary Guo" <gary@garyguo.net>, "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Simona Vetter" <simona@ffwll.ch>,
"Abdiel Janulgue" <abdiel.janulgue@gmail.com>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Robin Murphy" <robin.murphy@arm.com>,
"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
"Yury Norov" <yury.norov@gmail.com>,
"Will Deacon" <will@kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Waiman Long" <longman@redhat.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Yury Norov" <ynorov@nvidia.com>,
rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
driver-core@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH v3 4/4] rust: make `build_assert` module the home of related macros
Date: Sat, 21 Mar 2026 22:05:22 +0900 [thread overview]
Message-ID: <DH8HDA6Q6FU3.3JR57W97IO1VE@nvidia.com> (raw)
In-Reply-To: <20260319121653.2975748-5-gary@kernel.org>
On Thu Mar 19, 2026 at 9:16 PM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Given the macro scoping rules, all macros are rendered 3 times, in the
> module, in the top-level of kernel crate, and in the prelude.
>
> Add `#[doc(no_inline)]` to the prelude so it just shows up as re-export.
> Add `#[doc(hidden)]` to the macro definition and `#[doc(inline)]` to the
> re-export inside `build_assert` module so the top-level items are hidden.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> drivers/gpu/nova-core/bitfield.rs | 4 ++--
> drivers/gpu/nova-core/num.rs | 2 +-
> rust/kernel/build_assert.rs | 19 ++++++++++++-------
> rust/kernel/dma.rs | 5 +++--
> rust/kernel/io/register.rs | 19 ++++++++++++-------
> rust/kernel/io/resource.rs | 2 +-
> rust/kernel/ioctl.rs | 2 +-
> rust/kernel/net/phy/reg.rs | 8 +++++---
> rust/kernel/num/bounded.rs | 2 +-
> rust/kernel/prelude.rs | 3 ++-
> rust/kernel/sync/atomic/internal.rs | 9 ++++++---
> rust/kernel/sync/atomic/predefine.rs | 2 +-
> rust/kernel/sync/locked_by.rs | 2 +-
> rust/kernel/sync/refcount.rs | 8 +++++---
> rust/kernel/xarray.rs | 10 ++++++++--
> 15 files changed, 61 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs
> index 16e143658c51..c3e1235ad7fb 100644
> --- a/drivers/gpu/nova-core/bitfield.rs
> +++ b/drivers/gpu/nova-core/bitfield.rs
> @@ -170,7 +170,7 @@ impl $name {
> (@check_field_bounds $hi:tt:$lo:tt $field:ident as bool) => {
> #[allow(clippy::eq_op)]
> const _: () = {
> - ::kernel::build_assert!(
> + ::kernel::build_assert::build_assert!(
Given that the `build_assert` module now hosts 3 different assert
macros, have we considered renaming it to just `assert`? Otherwise the
naming implies that it is more connected to the `build_assert` macro
than the others, which doesn't seem to be true.
next prev parent reply other threads:[~2026-03-21 13:05 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 12:16 [PATCH v3 0/4] add `const_assert!` macro and rework documentation Gary Guo
2026-03-19 12:16 ` [PATCH v3 1/4] rust: move `static_assert` into `build_assert` Gary Guo
2026-03-19 14:09 ` Alice Ryhl
2026-03-19 12:16 ` [PATCH v3 2/4] rust: add `const_assert!` macro Gary Guo
2026-03-19 14:12 ` Alice Ryhl
2026-03-19 14:26 ` Gary Guo
2026-03-19 14:34 ` Alice Ryhl
2026-03-21 13:05 ` Alexandre Courbot
2026-03-19 12:16 ` [PATCH v3 3/4] rust: rework `build_assert!` documentation Gary Guo
2026-03-19 14:17 ` Alice Ryhl
2026-03-21 13:05 ` Alexandre Courbot
2026-03-19 12:16 ` [PATCH v3 4/4] rust: make `build_assert` module the home of related macros Gary Guo
2026-03-19 14:14 ` Danilo Krummrich
2026-03-19 14:14 ` Danilo Krummrich
2026-03-19 14:33 ` Alice Ryhl
2026-03-19 14:33 ` Alice Ryhl
2026-03-21 13:05 ` Alexandre Courbot [this message]
2026-03-21 13:05 ` Alexandre Courbot
2026-03-21 13:32 ` Gary Guo
2026-03-21 13:32 ` Gary Guo
2026-03-21 13:41 ` Miguel Ojeda
2026-03-21 13:41 ` Miguel Ojeda
2026-03-22 23:36 ` Miguel Ojeda
2026-03-22 23:36 ` Miguel Ojeda
2026-03-23 1:08 ` Alexandre Courbot
2026-03-23 1:08 ` Alexandre Courbot
2026-03-23 1:38 ` Miguel Ojeda
2026-03-23 1:38 ` Miguel Ojeda
2026-03-23 1:50 ` Alexandre Courbot
2026-03-26 12:09 ` FUJITA Tomonori
2026-03-26 12:09 ` FUJITA Tomonori
2026-03-27 18:42 ` Boqun Feng
2026-03-27 18:42 ` Boqun Feng
2026-03-23 0:15 ` Tamir Duberstein
2026-03-23 0:15 ` Tamir Duberstein
2026-03-19 14:15 ` [PATCH v3 0/4] add `const_assert!` macro and rework documentation Danilo Krummrich
2026-03-29 17:28 ` Miguel Ojeda
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=DH8HDA6Q6FU3.3JR57W97IO1VE@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=abdiel.janulgue@gmail.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=driver-core@lists.linux.dev \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=gary@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=lossin@kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=robin.murphy@arm.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=will@kernel.org \
--cc=ynorov@nvidia.com \
--cc=yury.norov@gmail.com \
/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.