linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: device: fix unresolved link to drm::Device
@ 2025-08-29 19:57 Danilo Krummrich
  2025-08-30  6:22 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Danilo Krummrich @ 2025-08-29 19:57 UTC (permalink / raw)
  To: gregkh, rafael
  Cc: rust-for-linux, linux-kernel, Danilo Krummrich, Alice Ryhl,
	kernel test robot

drm::Device is only available when CONFIG_DRM=y, which we have to
consider for intra-doc links, otherwise the rustdoc make target produces
the following warning.

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

Fix this by making the intra-doc link conditional on CONFIG_DRM being enabled.

Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508261644.9LclwUgt-lkp@intel.com/
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 rust/kernel/device.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index 5902b3714a16..a1db49eb159a 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -138,7 +138,9 @@
 /// }
 /// ```
 ///
-/// An example for a class device implementation is [`drm::Device`].
+/// An example for a class device implementation is
+#[cfg_attr(CONFIG_DRM = "y", doc = "[`drm::Device`](kernel::drm::Device).")]
+#[cfg_attr(not(CONFIG_DRM = "y"), doc = "`drm::Device`.")]
 ///
 /// # Invariants
 ///
@@ -151,7 +153,6 @@
 /// dropped from any thread.
 ///
 /// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
-/// [`drm::Device`]: kernel::drm::Device
 /// [`impl_device_context_deref`]: kernel::impl_device_context_deref
 /// [`pci::Device`]: kernel::pci::Device
 /// [`platform::Device`]: kernel::platform::Device

base-commit: 1b237f190eb3d36f52dffe07a40b5eb210280e00
-- 
2.51.0


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

* Re: [PATCH] rust: device: fix unresolved link to drm::Device
  2025-08-29 19:57 [PATCH] rust: device: fix unresolved link to drm::Device Danilo Krummrich
@ 2025-08-30  6:22 ` Greg KH
  2025-08-30  8:20 ` Alice Ryhl
  2025-09-02 13:16 ` Danilo Krummrich
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2025-08-30  6:22 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: rafael, rust-for-linux, linux-kernel, Alice Ryhl,
	kernel test robot

On Fri, Aug 29, 2025 at 09:57:42PM +0200, Danilo Krummrich wrote:
> drm::Device is only available when CONFIG_DRM=y, which we have to
> consider for intra-doc links, otherwise the rustdoc make target produces
> the following warning.
> 
> >> warning: unresolved link to `kernel::drm::Device`
>    --> rust/kernel/device.rs:154:22
>    |
>    154 | /// [`drm::Device`]: kernel::drm::Device
>    |                      ^^^^^^^^^^^^^^^^^^^ no item named `drm` in module `kernel`
>    |
>    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
> 
> Fix this by making the intra-doc link conditional on CONFIG_DRM being enabled.
> 
> Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508261644.9LclwUgt-lkp@intel.com/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  rust/kernel/device.rs | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH] rust: device: fix unresolved link to drm::Device
  2025-08-29 19:57 [PATCH] rust: device: fix unresolved link to drm::Device Danilo Krummrich
  2025-08-30  6:22 ` Greg KH
@ 2025-08-30  8:20 ` Alice Ryhl
  2025-09-02 13:16 ` Danilo Krummrich
  2 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-08-30  8:20 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: gregkh, rafael, rust-for-linux, linux-kernel, kernel test robot

On Fri, Aug 29, 2025 at 9:58 PM Danilo Krummrich <dakr@kernel.org> wrote:
>
> drm::Device is only available when CONFIG_DRM=y, which we have to
> consider for intra-doc links, otherwise the rustdoc make target produces
> the following warning.
>
> >> warning: unresolved link to `kernel::drm::Device`
>    --> rust/kernel/device.rs:154:22
>    |
>    154 | /// [`drm::Device`]: kernel::drm::Device
>    |                      ^^^^^^^^^^^^^^^^^^^ no item named `drm` in module `kernel`
>    |
>    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
>
> Fix this by making the intra-doc link conditional on CONFIG_DRM being enabled.
>
> Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508261644.9LclwUgt-lkp@intel.com/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

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

* Re: [PATCH] rust: device: fix unresolved link to drm::Device
  2025-08-29 19:57 [PATCH] rust: device: fix unresolved link to drm::Device Danilo Krummrich
  2025-08-30  6:22 ` Greg KH
  2025-08-30  8:20 ` Alice Ryhl
@ 2025-09-02 13:16 ` Danilo Krummrich
  2 siblings, 0 replies; 4+ messages in thread
From: Danilo Krummrich @ 2025-09-02 13:16 UTC (permalink / raw)
  To: gregkh, rafael
  Cc: rust-for-linux, linux-kernel, Alice Ryhl, kernel test robot

On Fri Aug 29, 2025 at 9:57 PM CEST, Danilo Krummrich wrote:
> drm::Device is only available when CONFIG_DRM=y, which we have to
> consider for intra-doc links, otherwise the rustdoc make target produces
> the following warning.
>
>>> warning: unresolved link to `kernel::drm::Device`
>    --> rust/kernel/device.rs:154:22
>    |
>    154 | /// [`drm::Device`]: kernel::drm::Device
>    |                      ^^^^^^^^^^^^^^^^^^^ no item named `drm` in module `kernel`
>    |
>    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
>
> Fix this by making the intra-doc link conditional on CONFIG_DRM being enabled.
>
> Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508261644.9LclwUgt-lkp@intel.com/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Applied to driver-core-linus, thanks!

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

end of thread, other threads:[~2025-09-02 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 19:57 [PATCH] rust: device: fix unresolved link to drm::Device Danilo Krummrich
2025-08-30  6:22 ` Greg KH
2025-08-30  8:20 ` Alice Ryhl
2025-09-02 13:16 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).