From: Danilo Krummrich <dakr@kernel.org>
To: dakr@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org,
aliceryhl@google.com, daniel.almeida@collabora.com,
arnd@arndb.de, ojeda@kernel.org, boqun@kernel.org,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu, tamird@kernel.org,
acourbot@nvidia.com, work@onurozkan.dev
Cc: driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] rust: io: gate ioremap doctests on CONFIG_HAS_IOMEM
Date: Wed, 5 Aug 2026 23:28:36 +0200 [thread overview]
Message-ID: <20260805212920.1996937-2-dakr@kernel.org> (raw)
In-Reply-To: <20260805212920.1996937-1-dakr@kernel.org>
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")
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
rust/kernel/devres.rs | 1 +
rust/kernel/io.rs | 1 +
2 files changed, 2 insertions(+)
diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs
index 11ce500e9b76..8ff8aedf251a 100644
--- a/rust/kernel/devres.rs
+++ b/rust/kernel/devres.rs
@@ -59,6 +59,7 @@ struct Inner<T> {
/// # Examples
///
/// ```no_run
+/// # #![cfg(CONFIG_HAS_IOMEM)]
/// use kernel::{
/// bindings,
/// device::{
diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
index d30bb5c6d4fc..d4063ee41200 100644
--- a/rust/kernel/io.rs
+++ b/rust/kernel/io.rs
@@ -81,6 +81,7 @@ pub fn maxsize(&self) -> usize {
/// # Examples
///
/// ```no_run
+/// # #![cfg(CONFIG_HAS_IOMEM)]
/// use kernel::{
/// bindings,
/// ffi::c_void,
--
2.55.0
next prev parent reply other threads:[~2026-08-05 21:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 21:28 [PATCH v2 1/2] rust: io: gate ioremap/iounmap on CONFIG_HAS_IOMEM Danilo Krummrich
2026-08-05 21:28 ` Danilo Krummrich [this message]
2026-08-05 21:40 ` [PATCH v2 2/2] rust: io: gate ioremap doctests " Arnd Bergmann
2026-08-05 21:39 ` [PATCH v2 1/2] rust: io: gate ioremap/iounmap " Arnd Bergmann
2026-08-06 15:47 ` Danilo Krummrich
2026-08-06 16:09 ` Arnd Bergmann
2026-08-06 15:58 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805212920.1996937-2-dakr@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=arnd@arndb.de \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.