[PATCH v2] rust: helpers: Remove volatile qualifier from io helpers
Danilo Krummrich
dakr at kernel.org
Mon Apr 14 14:24:29 PDT 2025
On Sat, Apr 12, 2025 at 09:53:41AM +0900, FUJITA Tomonori 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 at gmail.com>
Reviewed-by: Danilo Krummrich <dakr at kernel.org>
@Miguel: This originally landed through driver-core, but I guess subsequent
patches should go through the Rust tree.
More information about the linux-um
mailing list