Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gary Guo" <gary@garyguo.net>
Cc: dri-devel@lists.freedesktop.org,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	ojeda@kernel.org, linux-pci@vger.kernel.org,
	"Danilo Krummrich" <dakr@kernel.org>
Subject: Re: [PATCH 10/10] rust: io: register: remove relative registers
Date: Tue, 21 Jul 2026 17:08:18 +0000	[thread overview]
Message-ID: <20260721170819.5549E1F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260721-typed_register-v1-10-452d72b60262@garyguo.net>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] Broken intra-doc link for `WithBase` in module documentation.
- [Low] Leftover macro syntax for relative register aliases (`+ $alias_offset`) causes confusing internal macro errors.
--

--- Patch [10]: [PATCH 10/10] rust: io: register: remove relative registers ---
commit 9b1276cccc7f1b5ecb5c4e81e0c27d5b7d2f2492
Author: Gary Guo <gary@garyguo.net>

rust: io: register: remove relative registers

Relative registers can be better served by projection to subregion instead
of ad-hoc handling in register macro. Projection composes better (e.g. it
natively allows relative registers of relative registers without needing
additional support).

> diff --git a/rust/kernel/io/register.rs b/rust/kernel/io/register.rs
> index df47c28ba4f40..88ead1c1874fb 100644
> --- a/rust/kernel/io/register.rs
> +++ b/rust/kernel/io/register.rs
> @@ -191,78 +191,6 @@ fn offset(self) -> usize {
>      }
>  }
>  
> -/// Trait providing a base address to be added to the offset of a relative register to obtain
> -/// its actual offset.
[ ... ]
> -/// Trait implemented by all registers that are relative to a base.
> -pub trait WithBase {

[Severity: Low]
With WithBase removed here, does the register.rs module documentation need
to be updated? The module doc still references it in its intra-doc links:

//! items you might want to import from this module are [`WithBase`] and [`Array`].

Since kernel rustdoc compilation is strict about broken intra-doc links, could
this cause the rustdoc build to fail?

[ ... ]

> @@ -847,7 +479,7 @@ macro_rules! register {
>          $(
>              $(#[$attr:meta])* $vis:vis $name:ident ($storage:ty)
>                  $([ $size:expr $(, stride = $stride:expr)? ])?
> -                $(@ $($base:ident +)? $offset:literal)?
> +                $(@ $offset:literal)?
>                  $(=> $alias:ident $(+ $alias_offset:ident)? $([$alias_idx:expr])? )?
>              { $($fields:tt)* }
>          )*
> @@ -855,7 +487,7 @@ macro_rules! register {
>          $(
>          $crate::register!(
>              @reg [$reg_base] $(#[$attr])* $vis $name ($storage) $([$size $(, stride = $stride)?])?
> -                $(@ $($base +)? $offset)?
> +                $(@ $offset)?
>                  $(=> $alias $(+ $alias_offset)? $([$alias_idx])? )?

[Severity: Low]
Does the macro entry point still need to parse $(+ $alias_offset:ident)? and
forward $(+ $alias_offset)? now that the internal @reg macro arms handling
relative alias syntax have been removed?

If someone accidentally defines a register using the removed relative alias
syntax (e.g., => Base + Alias), could this cause a confusing internal macro
matching error instead of a clean rejection?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260721-typed_register-v1-0-452d72b60262@garyguo.net?part=10

      reply	other threads:[~2026-07-21 17:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 16:54 [PATCH 00/10] rust: io: make register bases typed and remove relative registers Gary Guo
2026-07-21 16:54 ` [PATCH 01/10] rust: io: register: allow explicit base type specification Gary Guo
2026-07-21 16:58   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 02/10] gpu: nova-core: specify base type for registers Gary Guo
2026-07-21 16:59   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 03/10] drm/tyr: " Gary Guo
2026-07-21 17:10   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 04/10] samples: rust: pci: " Gary Guo
2026-07-21 17:03   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 05/10] rust: io: register: make register have a typed base Gary Guo
2026-07-21 17:00   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 06/10] rust: io: add static `cast()` method for views Gary Guo
2026-07-21 17:08   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 07/10] rust: io: add subregion method with compile-time check Gary Guo
2026-07-21 17:05   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 08/10] gpu: nova-core: use projection for PFALCON and PFALCON2 registers Gary Guo
2026-07-21 17:00   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 09/10] gpu: nova-core: convert hshub0 from relative register to projection Gary Guo
2026-07-21 17:18   ` sashiko-bot
2026-07-21 16:54 ` [PATCH 10/10] rust: io: register: remove relative registers Gary Guo
2026-07-21 17:08   ` sashiko-bot [this message]

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=20260721170819.5549E1F00AC4@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-pci@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.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