Re: [PATCH v2 16/16] rust: io: register: unify handling of register with/without bitfields

"Alexandre Courbot" <[email protected]>
Newsgroups dev.linux.lists.driver-core,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Thu Aug 6, 2026 at 1:35 AM JST, Gary Guo wrote:
<...>
> @@ -577,6 +547,9 @@ macro_rules! register {
>      (base: $reg_base:ty;) => {};
>  
>      // Creates a register at a fixed offset of the MMIO space with provided type.
> +    //
> +    // This handles all of the fixed offset `@ offset`, alias of register `=> alias` and alias of
> +    // register array element `=> alias[idx]` cases.
>      (
>          base: $reg_base:ty;
>          // `$ty` cannot be `:ty` due to follow-set restrictions.
> @@ -593,10 +566,29 @@ macro_rules! register {
>          $crate::register!(base: $reg_base; $($rest)*);
>      };
>  
> +    // `#[unique]` indicates that this is the only register of this type in this given register.

Sentence doesn't parse (in this given register?).

> +    // Thus generate a `FixedIoLoc` impl for it as well.
> +    (
> +        base: $reg_base:ty;
> +        $(#[$attr:meta])* $vis:vis $name:ident: #[unique] $ty: ident $(:: $path_frag:ident)*
> +            $(@ $offset:literal)?
> +            $(=> $alias:path $([$alias_idx:expr])? )?;
> +        $($rest:tt)*

This rule looks like it should be private, or am I mistaken?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.