Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Incomplete macro parser update preventing the use of qualified paths 
for fixed and indexed alias destinations.
--

--- Patch [3]: [PATCH 3/8] rust: io: register: use path fragment for alias 
destination ---
commit 2d0652e05a1a9983e77fe52bcfa5cbaeead4c274
Author: Alexandre Courbot <[email protected]>

rust: io: register: use path fragment for alias destination

This commit updates the register! macro to use a path fragment instead of
ident for alias destinations. This aims to allow referencing registers using
a qualified path instead of only identifiers visible from the current module.

> diff --git a/rust/kernel/io/register.rs b/rust/kernel/io/register.rs
> index 82f674aea45a2..1e0e23e4233fa 100644
> --- a/rust/kernel/io/register.rs
> +++ b/rust/kernel/io/register.rs
> @@ -809,7 +809,7 @@ macro_rules! register {
>              $(#[$attr:meta])* $vis:vis $name:ident ($storage:ty)
>                  $([ $size:expr $(, stride = $stride:expr)? ])?
>                  $(@ $($base:ident +)? $offset:literal)?
> -                $(=> $alias:ident $(+ $alias_offset:ident)? 
> $([$alias_idx:expr])? )?
> +                $(=> $alias:ident $(+ $alias_offset:path)? 
> $([$alias_idx:expr])? )?

[Severity: Medium]
Does this top-level rule unintentionally restrict fixed and indexed aliases?

While the inner @reg rules were updated to use $alias:path, this main parsing
rule still captures $alias as an ident. Because of this, it appears that
using a qualified path (like => module::ALIAS) for fixed or indexed aliases
will fail to match here and result in a compilation error.

Should $alias:ident also be changed to $alias:path in this top-level
match pattern so that fixed and indexed aliases can fully benefit from this
update?

>              { $($fields:tt)* }
>          )*
>      ) => {

[ ... ]

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to