Re: [PATCH v2] rust: helpers: Remove volatile qualifier from io helpers

From: Miguel Ojeda
Date: Tue Apr 15 2025 - 12:28:48 EST


On Sat, Apr 12, 2025 at 2:54 AM FUJITA Tomonori
<fujita.tomonori@xxxxxxxxx> wrote:
>
> Remove the `volatile` qualifier used with __iomem in helper functions
> in io.c. These helper functions are just wrappers around the
> corresponding accessors so they are unnecessary.
>
> This fixes the following UML build error with CONFIG_RUST enabled:
>
> In file included from /home/fujita/git/linux-rust/rust/helpers/helpers.c:19:
> /home/fujita/git/linux-rust/rust/helpers/io.c:12:10: error: passing 'volatile void *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> 12 | iounmap(addr);
> | ^~~~
> /home/fujita/git/linux-rust/arch/um/include/asm/io.h:19:42: note: passing argument to parameter 'addr' here
> 19 | static inline void iounmap(void __iomem *addr)
> | ^
> 1 error generated.
>
> Fixes: ce30d94e6855 ("rust: add `io::{Io, IoRaw}` base types")
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>

I don't particularly like having different signatures than the other
side (since we could e.g. eventually have a check that they match
etc.), but given v1 it seems they could also be eventually gone from
the C side anyway.

Cc: stable, I assume, too?

Thanks!

Cheers,
Miguel