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

"Gary Guo" <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,dev.linux.lists.driver-core,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
> ---
>  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.

>          );
>      };
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.