summaryrefslogtreecommitdiffstats
path: root/rust/helpers/dma.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2025-04-12 09:53:41 +0900
committerMiguel Ojeda <ojeda@kernel.org>2025-04-15 23:03:00 +0200
commit584e61452f75bfeac2cdd83730b4059526ec60c7 (patch)
tree81d62b53925e483ca19c3df3c25b6175c3264aee /rust/helpers/dma.c
parent1c4494c14b4124f3a13a7f4912b84b633ff4f9ba (diff)
downloadlinux-584e61452f75bfeac2cdd83730b4059526ec60c7.tar.gz
linux-584e61452f75bfeac2cdd83730b4059526ec60c7.tar.bz2
linux-584e61452f75bfeac2cdd83730b4059526ec60c7.zip
rust: helpers: Remove volatile qualifier from io helpers
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 rust/helpers/helpers.c:19: 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); | ^~~~ 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. [ Arnd explains [1] that removing the qualifier is the way forward (thanks!): Rihgt, I tried this last week when it came up first, removing the 'volatile' annotations in the asm-generic/io.h header and then all the ones that caused build regressions on arm/arm64/x86 randconfig and allmodconfig builds. This patch is a little longer than my original version as I did run into a few regressions later. As far as I can tell, none of these volatile annotations have any actual effect, and most of them date back to ancient kernels where this may have been required. Leaving it out of the rust interface is clearly the right way, and it shouldn't be too hard to upstream the changes below when we need to, but I also don't see any priority to send these. If anyone wants to help out, I can send them the whole patch. I created an issue [2] in case someone wants to help. - Miguel ] Fixes: ce30d94e6855 ("rust: add `io::{Io, IoRaw}` base types") Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/rust-for-linux/0c844b70-19c7-4b14-ba29-fc99ae0d69f0@app.fastmail.com/ [1] Link: https://github.com/Rust-for-Linux/linux/issues/1156 [2] Link: https://lore.kernel.org/r/20250412005341.157150-1-fujita.tomonori@gmail.com [ Reworded for relative paths. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/helpers/dma.c')
0 files changed, 0 insertions, 0 deletions