[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <45B18878-7472-4AFD-88FB-BDE80FAF5EE3@collabora.com>
Date: Fri, 25 Jul 2025 14:58:37 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Danilo Krummrich <dakr@...nel.org>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Beata Michalska <beata.michalska@....com>,
nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 13/19] gpu: nova-core: register: split @io rule into
fixed and relative versions
> On 18 Jul 2025, at 04:26, Alexandre Courbot <acourbot@...dia.com> wrote:
>
> We used the same @io rule with different patterns to define both the
> fixed and relative I/O accessors. This can be confusing as the matching
> rules are very similar.
>
> Since all call sites know which version they want to call, split @io
> into @io_fixed and @io_relative to remove any ambiguity.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> drivers/gpu/nova-core/regs/macros.rs | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs
> index f0942dc29210f703fddd4d86b758173f75b3477a..bfa0220050d4ba03c9fcd75c9be1ed8dbaa4f290 100644
> --- a/drivers/gpu/nova-core/regs/macros.rs
> +++ b/drivers/gpu/nova-core/regs/macros.rs
> @@ -89,25 +89,25 @@ macro_rules! register {
> // Creates a register at a fixed offset of the MMIO space.
> ($name:ident @ $offset:literal $(, $comment:literal)? { $($fields:tt)* } ) => {
> register!(@core $name $(, $comment)? { $($fields)* } );
> - register!(@io $name @ $offset);
> + register!(@io_fixed $name @ $offset);
> };
>
> // Creates an alias register of fixed offset register `alias` with its own fields.
> ($name:ident => $alias:ident $(, $comment:literal)? { $($fields:tt)* } ) => {
> register!(@core $name $(, $comment)? { $($fields)* } );
> - register!(@io $name @ $alias::OFFSET);
> + register!(@io_fixed $name @ $alias::OFFSET);
> };
>
> // Creates a register at a relative offset from a base address.
> ($name:ident @ + $offset:literal $(, $comment:literal)? { $($fields:tt)* } ) => {
> register!(@core $name $(, $comment)? { $($fields)* } );
> - register!(@io $name @ + $offset);
> + register!(@io_relative $name @ + $offset);
> };
>
> // Creates an alias register of relative offset register `alias` with its own fields.
> ($name:ident => + $alias:ident $(, $comment:literal)? { $($fields:tt)* } ) => {
> register!(@core $name $(, $comment)? { $($fields)* } );
> - register!(@io $name @ + $alias::OFFSET);
> + register!(@io_relative $name @ + $alias::OFFSET);
> };
>
> // All rules below are helpers.
> @@ -342,7 +342,7 @@ fn default() -> Self {
> };
>
> // Generates the IO accessors for a fixed offset register.
> - (@io $name:ident @ $offset:expr) => {
> + (@io_fixed $name:ident @ $offset:expr) => {
> #[allow(dead_code)]
> impl $name {
> pub(crate) const OFFSET: usize = $offset;
> @@ -380,7 +380,7 @@ pub(crate) fn alter<const SIZE: usize, T, F>(
> };
>
> // Generates the IO accessors for a relative offset register.
> - (@io $name:ident @ + $offset:literal) => {
> + (@io_relative $name:ident @ + $offset:literal) => {
> #[allow(dead_code)]
> impl $name {
> pub(crate) const OFFSET: usize = $offset;
>
> --
> 2.50.1
>
>
Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>
Powered by blists - more mailing lists