Skip to contentSkip to conversation

rust: io: fix broken intra-doc link to missing `flags` module

PATCH In review Miguel Ojeda 3 participants 4 messages Jul 22, 2025

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/2 rust: io: fix broken intra-doc link to missing `flags` module

There is no mod flags in this case, unlike others. Instead, they are associated constants for the Flags type.

Thus reword the sentence to fix the broken intra-doc link, providing an example of constant and linking to it to clarify which ones we are referring to.

Fixes 493fc33ec252 ("rust: io: add resource abstraction")
---
 rust/kernel/io/resource.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rust/kernel/io/resource.rs +2 -1
index 1d5f367a6e8a..bea3ee0ed87b 100644
@@ -177,7 +177,8 @@ unsafe impl Sync for Resource {}
 ///
 /// They can be combined with the operators `|`, `&`, and `!`.
 ///
-/// Values can be used from the [`flags`] module.
+/// Values can be used from the associated constants such as
+/// [`Flags::IORESOURCE_IO`].
 #[derive(Clone, Copy, PartialEq)]
 pub struct Flags(c_ulong);
 

base-commit: 696b2a6ce9487ae278fd239658ca2714cd211e8e

Signature · 1 line
2.50.1
author maintainer
#1 lore raw

PATCH 2/2 rust: io: fix broken intra-doc links to `platform::Device`

platform is not accessible from here.

Thus fix the intra-doc links by qualifying the paths a bit more.

Fixes 1d0d4b28513b ("rust: io: mem: add a generic iomem abstraction")
---
 rust/kernel/io/mem.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
rust/kernel/io/mem.rs +4 -4
index cc9feb2897d8..6f99510bfc3a 100644
@@ -40,8 +40,8 @@ pub(crate) unsafe fn new(device: &'a Device<Bound>, resource: &'a Resource) -> S
     ///
     /// # Examples
     ///
-    /// The following example uses a [`platform::Device`] for illustration
-    /// purposes.
+    /// The following example uses a [`kernel::platform::Device`] for
+    /// illustration purposes.
     ///
     /// ```no_run
     /// use kernel::{bindings, c_str, platform, of, device::Core};
@@ -98,8 +98,8 @@ pub fn iomap_exclusive_sized<const SIZE: usize>(
     ///
     /// # Examples
     ///
-    /// The following example uses a [`platform::Device`] for illustration
-    /// purposes.
+    /// The following example uses a [`kernel::platform::Device`] for
+    /// illustration purposes.
     ///
     /// ```no_run
     /// use kernel::{bindings, c_str, platform, of, device::Core};
Signature · 1 line
2.50.1
#2 lore raw
In reply to Miguel Ojeda
Quoted 11 lines · Miguel Ojeda

There is no mod flags in this case, unlike others. Instead, they are associated constants for the Flags type.

Thus reword the sentence to fix the broken intra-doc link, providing an example of constant and linking to it to clarify which ones we are referring to.

Fixes 493fc33ec252 ("rust: io: add resource abstraction")

---

I should have mentioned that, as usual, please feel free to rebase these if preferred (I think you don't in that tree, but nevertheless...)

These two are meant to clean -next (and rust.docs.kernel.org, which I build with WERROR so far).

Cheers,
Miguel

maintainer
#3 lore raw
In reply to Miguel Ojeda
Quoted 9 lines · Miguel Ojeda

There is no mod flags in this case, unlike others. Instead, they are associated constants for the Flags type.

Thus reword the sentence to fix the broken intra-doc link, providing an example of constant and linking to it to clarify which ones we are referring to.

Fixes 493fc33ec252 ("rust: io: add resource abstraction")

Thanks for catching this and the other documentation warning.

Applied to driver-core-testing, thanks!