public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] rust: dma: fix broken intra-doc links
@ 2025-12-31  4:57 FUJITA Tomonori
  2025-12-31  4:57 ` [PATCH v1 2/2] rust: device: " FUJITA Tomonori
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: FUJITA Tomonori @ 2025-12-31  4:57 UTC (permalink / raw)
  To: dakr, gregkh, ojeda, rafael, aliceryhl
  Cc: a.hindborg, abdiel.janulgue, bjorn3_gh, boqun.feng,
	daniel.almeida, gary, lossin, robin.murphy, tmgross,
	rust-for-linux

The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
intra-doc like to `pci::Device` cause rustdoc warnings:

warning: unresolved link to `::kernel::pci::Device`
  --> rust/kernel/dma.rs:30:70
   |
30 | /// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
   |                                                                      ^^^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`

Fix this by making the documentation conditional on CONFIG_PCI.

Fixes: d06d5f66f549 ("rust: dma: implement `dma::Device` trait")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
 rust/kernel/dma.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs
index 2ac107d8f7b7..42542203b037 100644
--- a/rust/kernel/dma.rs
+++ b/rust/kernel/dma.rs
@@ -27,8 +27,9 @@
 /// Trait to be implemented by DMA capable bus devices.
 ///
 /// The [`dma::Device`](Device) trait should be implemented by bus specific device representations,
-/// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
-/// [`platform::Device`](::kernel::platform::Device).
+/// where the underlying bus is DMA capable:
+#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
+/// * [`platform::Device`](::kernel::platform::Device)
 pub trait Device: AsRef<device::Device<Core>> {
     /// Set up the device's DMA streaming addressing capabilities.
     ///

base-commit: 4c9f6a782f6078dc94450fcb22e65d520bfa0775
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v1 2/2] rust: device: fix broken intra-doc links
  2025-12-31  4:57 [PATCH v1 1/2] rust: dma: fix broken intra-doc links FUJITA Tomonori
@ 2025-12-31  4:57 ` FUJITA Tomonori
  2026-01-02 18:08   ` Danilo Krummrich
  2025-12-31  6:08 ` [PATCH v1 1/2] rust: dma: " Dirk Behme
  2026-01-02 18:08 ` Danilo Krummrich
  2 siblings, 1 reply; 8+ messages in thread
From: FUJITA Tomonori @ 2025-12-31  4:57 UTC (permalink / raw)
  To: dakr, gregkh, ojeda, rafael, aliceryhl
  Cc: a.hindborg, abdiel.janulgue, bjorn3_gh, boqun.feng,
	daniel.almeida, gary, lossin, robin.murphy, tmgross,
	rust-for-linux

The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
intra-doc like to `pci::Device` cause rustdoc warnings:

warning: unresolved link to `kernel::pci::Device`
   --> rust/kernel/device.rs:163:22
    |
163 | /// [`pci::Device`]: kernel::pci::Device
    |                      ^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`
    |
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

Fix this by making the documentation conditional on CONFIG_PCI.

Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
 rust/kernel/device.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index c79be2e2bfe3..17735f980997 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -67,8 +67,9 @@
 ///
 /// # Implementing Bus Devices
 ///
-/// This section provides a guideline to implement bus specific devices, such as [`pci::Device`] or
-/// [`platform::Device`].
+/// This section provides a guideline to implement bus specific devices:
+#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
+/// * [`platform::Device`]
 ///
 /// A bus specific device should be defined as follows.
 ///
@@ -160,7 +161,6 @@
 ///
 /// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
 /// [`impl_device_context_deref`]: kernel::impl_device_context_deref
-/// [`pci::Device`]: kernel::pci::Device
 /// [`platform::Device`]: kernel::platform::Device
 #[repr(transparent)]
 pub struct Device<Ctx: DeviceContext = Normal>(Opaque<bindings::device>, PhantomData<Ctx>);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] rust: dma: fix broken intra-doc links
  2025-12-31  4:57 [PATCH v1 1/2] rust: dma: fix broken intra-doc links FUJITA Tomonori
  2025-12-31  4:57 ` [PATCH v1 2/2] rust: device: " FUJITA Tomonori
@ 2025-12-31  6:08 ` Dirk Behme
  2025-12-31  9:07   ` FUJITA Tomonori
  2026-01-02 18:08 ` Danilo Krummrich
  2 siblings, 1 reply; 8+ messages in thread
From: Dirk Behme @ 2025-12-31  6:08 UTC (permalink / raw)
  To: FUJITA Tomonori, dakr, gregkh, ojeda, rafael, aliceryhl
  Cc: a.hindborg, abdiel.janulgue, bjorn3_gh, boqun.feng,
	daniel.almeida, gary, lossin, robin.murphy, tmgross,
	rust-for-linux

On 31.12.25 05:57, FUJITA Tomonori wrote:
> The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
> intra-doc like to `pci::Device` cause rustdoc warnings:

Typos?

like -> link
cause -> causes

Same in 2/2.

Dirk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] rust: dma: fix broken intra-doc links
  2025-12-31  6:08 ` [PATCH v1 1/2] rust: dma: " Dirk Behme
@ 2025-12-31  9:07   ` FUJITA Tomonori
  2025-12-31 16:13     ` Danilo Krummrich
  0 siblings, 1 reply; 8+ messages in thread
From: FUJITA Tomonori @ 2025-12-31  9:07 UTC (permalink / raw)
  To: dirk.behme, dakr
  Cc: fujita.tomonori, gregkh, ojeda, rafael, aliceryhl, a.hindborg,
	abdiel.janulgue, bjorn3_gh, boqun.feng, daniel.almeida, gary,
	lossin, robin.murphy, tmgross, rust-for-linux

On Wed, 31 Dec 2025 07:08:44 +0100
Dirk Behme <dirk.behme@gmail.com> wrote:

> On 31.12.25 05:57, FUJITA Tomonori wrote:
>> The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
>> intra-doc like to `pci::Device` cause rustdoc warnings:
> 
> Typos?
> 
> like -> link
> cause -> causes
> 
> Same in 2/2.

Thank you for pointing out the typos, and sorry about that.

Danilo, would you prefer that I send a revised patches or will you fix
them when applying?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] rust: dma: fix broken intra-doc links
  2025-12-31  9:07   ` FUJITA Tomonori
@ 2025-12-31 16:13     ` Danilo Krummrich
  2026-01-02  7:49       ` Dirk Behme
  0 siblings, 1 reply; 8+ messages in thread
From: Danilo Krummrich @ 2025-12-31 16:13 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: dirk.behme, gregkh, ojeda, rafael, aliceryhl, a.hindborg,
	abdiel.janulgue, bjorn3_gh, boqun.feng, daniel.almeida, gary,
	lossin, robin.murphy, tmgross, rust-for-linux

On Wed Dec 31, 2025 at 10:07 AM CET, FUJITA Tomonori wrote:
> Danilo, would you prefer that I send a revised patches or will you fix
> them when applying?

I can fix it up when applying the patches, no need to resend for this.

Thanks,
Danilo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] rust: dma: fix broken intra-doc links
  2025-12-31 16:13     ` Danilo Krummrich
@ 2026-01-02  7:49       ` Dirk Behme
  0 siblings, 0 replies; 8+ messages in thread
From: Dirk Behme @ 2026-01-02  7:49 UTC (permalink / raw)
  To: Danilo Krummrich, FUJITA Tomonori
  Cc: dirk.behme, gregkh, ojeda, rafael, aliceryhl, a.hindborg,
	abdiel.janulgue, bjorn3_gh, boqun.feng, daniel.almeida, gary,
	lossin, robin.murphy, tmgross, rust-for-linux

On 31/12/2025 17:13, Danilo Krummrich wrote:
> On Wed Dec 31, 2025 at 10:07 AM CET, FUJITA Tomonori wrote:
>> Danilo, would you prefer that I send a revised patches or will you fix
>> them when applying?
> 
> I can fix it up when applying the patches, no need to resend for this.

With the typos fixed while applying:

Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>

Same for second patch 2/2.

Thanks!

Dirk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] rust: dma: fix broken intra-doc links
  2025-12-31  4:57 [PATCH v1 1/2] rust: dma: fix broken intra-doc links FUJITA Tomonori
  2025-12-31  4:57 ` [PATCH v1 2/2] rust: device: " FUJITA Tomonori
  2025-12-31  6:08 ` [PATCH v1 1/2] rust: dma: " Dirk Behme
@ 2026-01-02 18:08 ` Danilo Krummrich
  2 siblings, 0 replies; 8+ messages in thread
From: Danilo Krummrich @ 2026-01-02 18:08 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: gregkh, ojeda, rafael, aliceryhl, a.hindborg, abdiel.janulgue,
	bjorn3_gh, boqun.feng, daniel.almeida, gary, lossin, robin.murphy,
	tmgross, rust-for-linux

On Wed Dec 31, 2025 at 5:57 AM CET, FUJITA Tomonori wrote:
> The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
> intra-doc like to `pci::Device` cause rustdoc warnings:
>
> warning: unresolved link to `::kernel::pci::Device`
>   --> rust/kernel/dma.rs:30:70
>    |
> 30 | /// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
>    |                                                                      ^^^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`
>
> Fix this by making the documentation conditional on CONFIG_PCI.
>
> Fixes: d06d5f66f549 ("rust: dma: implement `dma::Device` trait")
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Applied to driver-core-linus, thanks!

    [ Keep the "such as" part indicating a list of examples; fix typos in
      commit message. - Danilo ]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 2/2] rust: device: fix broken intra-doc links
  2025-12-31  4:57 ` [PATCH v1 2/2] rust: device: " FUJITA Tomonori
@ 2026-01-02 18:08   ` Danilo Krummrich
  0 siblings, 0 replies; 8+ messages in thread
From: Danilo Krummrich @ 2026-01-02 18:08 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: gregkh, ojeda, rafael, aliceryhl, a.hindborg, abdiel.janulgue,
	bjorn3_gh, boqun.feng, daniel.almeida, gary, lossin, robin.murphy,
	tmgross, rust-for-linux

On Wed Dec 31, 2025 at 5:57 AM CET, FUJITA Tomonori wrote:
> The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
> intra-doc like to `pci::Device` cause rustdoc warnings:
>
> warning: unresolved link to `kernel::pci::Device`
>    --> rust/kernel/device.rs:163:22
>     |
> 163 | /// [`pci::Device`]: kernel::pci::Device
>     |                      ^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`
>     |
>     = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
>
> Fix this by making the documentation conditional on CONFIG_PCI.
>
> Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Applied to driver-core-linus, thanks!

    [ Keep the "such as" part indicating a list of examples; fix typos in
      commit message. - Danilo ]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-02 18:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-31  4:57 [PATCH v1 1/2] rust: dma: fix broken intra-doc links FUJITA Tomonori
2025-12-31  4:57 ` [PATCH v1 2/2] rust: device: " FUJITA Tomonori
2026-01-02 18:08   ` Danilo Krummrich
2025-12-31  6:08 ` [PATCH v1 1/2] rust: dma: " Dirk Behme
2025-12-31  9:07   ` FUJITA Tomonori
2025-12-31 16:13     ` Danilo Krummrich
2026-01-02  7:49       ` Dirk Behme
2026-01-02 18:08 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox