]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: io: gate ioremap doctests on CONFIG_HAS_IOMEM
authorDanilo Krummrich <dakr@kernel.org>
Wed, 5 Aug 2026 21:28:36 +0000 (23:28 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 6 Aug 2026 14:05:50 +0000 (16:05 +0200)
commitf88db65aece9f9d26287b6377b7c7730ecf9f11a
tree1662843330e73a92a3c9053a8752f5c6b921c3d6
parent4f5f23846d6713c05481c8cfc710bb23817bf5e9
rust: io: gate ioremap doctests on CONFIG_HAS_IOMEM

The doc examples in io.rs and devres.rs directly call
bindings::ioremap() and bindings::iounmap(), which do not exist when
CONFIG_HAS_IOMEM is not set. This causes build failures with
CONFIG_RUST_KERNEL_DOCTESTS=y on such configurations (e.g. s390
allnoconfig).

Gate the affected doctests with `#![cfg(CONFIG_HAS_IOMEM)]` so they are
skipped when IOMEM is unavailable.

Fixes: 3f70ebe63858 ("s390: Enable Rust support")
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260805212920.1996937-2-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/devres.rs
rust/kernel/io.rs