Re: [PATCH 1/8] rust: io: register: dispatch fixed array shortcut internally

From: Gary Guo

Date: Tue Jul 21 2026 - 10:25:03 EST


On Tue Jul 21, 2026 at 12:00 PM BST, Alexandre Courbot wrote:
> The contiguous fixed-register-array shortcut redispatches an already
> normalized declaration through the public register! entry point. This is
> unneeded - the public rule should only be invoked by users.
>
> Dispatch directly to the appropriate internal @reg rule instead.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> rust/kernel/io/register.rs | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/kernel/io/register.rs b/rust/kernel/io/register.rs
> index 80e638a892d7..27a9fe45b06d 100644
> --- a/rust/kernel/io/register.rs
> +++ b/rust/kernel/io/register.rs
> @@ -888,7 +888,8 @@ macro_rules! register {
> { $($fields:tt)* }
> ) => {
> $crate::register!(
> - $(#[$attr])* $vis $name($storage) [ $size, stride = ::core::mem::size_of::<$storage>() ]
> + @reg $(#[$attr])* $vis $name($storage)
> + [ $size, stride = ::core::mem::size_of::<$storage>() ]
> @ $offset { $($fields)* }

Actually there are two rules that misses the @reg.

> );
> };