Fix broken `srctree/` links and warn about them
Subsystems (5)
Miguel Ojeda
maintainercover Fix broken `srctree/` links and warn about them
This fixes a handful of broken links and introduces a warning to prevent them from happening in the future.
Relatedly, we could also perhaps check the other side of the links, but perhaps there are cases we want to customize. Alternatively, we could also in the future introduce custom syntax for these that avoids repetition or a fancier preprocessing step.
Miguel Ojeda (3):
rust: block: fix srctree/ links
rust: drm: fix srctree/ links
rust: warn if srctree/ links do not exist
rust/Makefile | 6 ++++++ rust/kernel/block/mq/gen_disk.rs | 2 +- rust/kernel/drm/device.rs | 2 +- rust/kernel/drm/driver.rs | 2 +- rust/kernel/drm/file.rs | 2 +- rust/kernel/drm/gem/mod.rs | 2 +- rust/kernel/drm/ioctl.rs | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-)
--
2.50.1
Miguel Ojeda
maintainerPATCH 1/3 rust: block: fix `srctree/` links
This srctree/ link pointed to a file with an underscore, but the header used a dash instead.
Thus fix it.
This cleans a future warning that will check our srctree/ links.
--- rust/kernel/block/mq/gen_disk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/block/mq/gen_disk.rs +1 -1
@@ -3,7 +3,7 @@//! Generic disk abstraction. //! //! C header: [`include/linux/blkdev.h`](srctree/include/linux/blkdev.h) -//! C header: [`include/linux/blk_mq.h`](srctree/include/linux/blk_mq.h) +//! C header: [`include/linux/blk-mq.h`](srctree/include/linux/blk-mq.h) use crate ::block::mq::{raw_writer::RawWriter ,Operations ,TagSet };use crate ::{bindings, error::from_err_ptr, error::Result , sync::Arc };
Signature · 1 line
2.50.1
Miguel Ojeda
maintainerPATCH 2/3 rust: drm: fix `srctree/` links
In reply to Miguel OjedaThese srctree/ links pointed inside linux/, but they are directly under drm/.
Thus fix them.
This cleans a future warning that will check our srctree/ links.
--- rust/kernel/drm/device.rs | 2 +- rust/kernel/drm/driver.rs | 2 +- rust/kernel/drm/file.rs | 2 +- rust/kernel/drm/gem/mod.rs | 2 +- rust/kernel/drm/ioctl.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
rust/kernel/drm/device.rs +1 -1
@@ -2,7 +2,7 @@//! DRM device. //! -//! C header: [`include/linux/drm/drm_device.h`](srctree/include/linux/drm/drm_device.h) +//! C header: [`include/drm/drm_device.h`](srctree/include/drm/drm_device.h) use crate ::{ bindings, device, drm,
rust/kernel/drm/driver.rs +1 -1
@@ -2,7 +2,7 @@//! DRM driver core. //! -//! C header: [`include/linux/drm/drm_drv.h`](srctree/include/linux/drm/drm_drv.h) +//! C header: [`include/drm/drm_drv.h`](srctree/include/drm/drm_drv.h) use crate ::{ bindings, device,
rust/kernel/drm/file.rs +1 -1
@@ -2,7 +2,7 @@//! DRM File objects. //! -//! C header: [`include/linux/drm/drm_file.h`](srctree/include/linux/drm/drm_file.h) +//! C header: [`include/drm/drm_file.h`](srctree/include/drm/drm_file.h) use crate ::{bindings, drm, error::Result , prelude::*, types::Opaque };use core::marker::PhantomData ;
rust/kernel/drm/gem/mod.rs +1 -1
@@ -2,7 +2,7 @@//! DRM GEM API //! -//! C header: [`include/linux/drm/drm_gem.h`](srctree/include/linux/drm/drm_gem.h) +//! C header: [`include/drm/drm_gem.h`](srctree/include/drm/drm_gem.h) use crate ::{ alloc::flags::*,
rust/kernel/drm/ioctl.rs +1 -1
@@ -2,7 +2,7 @@//! DRM IOCTL definitions. //! -//! C header: [`include/linux/drm/drm_ioctl.h`](srctree/include/linux/drm/drm_ioctl.h) +//! C header: [`include/drm/drm_ioctl.h`](srctree/include/drm/drm_ioctl.h) use crate ::ioctl;
Signature · 1 line
2.50.1
Re: [PATCH 2/3] rust: drm: fix `srctree/` links
Quoted 5 lines · Miguel Ojeda
These
srctree/links pointed insidelinux/, but they are directly underdrm/.Thus fix them.
Quoted 8 lines
This cleans a future warning that will check our
srctree/links.Fixes a98a73be9ee9 ("rust: drm: file: Add File abstraction")Fixes c284d3e42338 ("rust: drm: gem: Add GEM object abstraction")Fixes 07c9016085f9 ("rust: drm: add driver abstractions")Fixes 1e4b8896c0f3 ("rust: drm: add device abstraction")Fixes 9a69570682b1 ("rust: drm: ioctl: Add DRM ioctl abstraction")Signed-off-by Miguel Ojeda <[email protected]>
Good catch!
Miguel Ojeda
maintainerPATCH 3/3 rust: warn if `srctree/` links do not exist
In reply to Miguel Ojedasrctree/ links may point to nonexistent files, e.g. due to renames that missed to update the files or simply because of typos.
Since they can be easily checked for validity, do so and print a warning in the file does not exist.
This found the following cases already in-tree:
warning: srctree/ link to include/linux/blk_mq.h does not exist
warning: srctree/ link to include/linux/drm/drm_gem.h does not exist
warning: srctree/ link to include/linux/drm/drm_drv.h does not exist
warning: srctree/ link to include/linux/drm/drm_ioctl.h does not exist
warning: srctree/ link to include/linux/drm/drm_file.h does not exist
warning: srctree/ link to include/linux/drm/drm_device.h does not exist
--- rust/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)
rust/Makefile +6 -0
@@ -93,6 +93,12 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $< # and then retouch the generated files. rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \ rustdoc-kernel rustdoc-pin_init + $(Q)grep -Ehro '<a href="srctree/([^"]+)"' $(rustdoc_output) | \ + cut -d'"' -f2 | cut -d/ -f2- | while read f; do \ + if [ ! -e "$(srctree)/$$f" ]; then \ + echo "warning: srctree/ link to $$f does not exist"; \ + fi \ + done $(Q)cp $(srctree)/Documentation/images/logo.svg $(rustdoc_output)/static.files/ $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output)/static.files/ $(Q)find $(rustdoc_output) -name '*.html' -type f -print0 | xargs -0 sed -Ei \
Signature · 1 line
2.50.1
Re: [PATCH 3/3] rust: warn if `srctree/` links do not exist
Quoted 40 lines · On Wed, 30 Jul 2025 15:07:16 +0200 Miguel Ojeda <[email protected]> wrote:
srctree/links may point to nonexistent files, e.g. due to renames that missed to update the files or simply because of typos.Since they can be easily checked for validity, do so and print a warning in the file does not exist.
This found the following cases already in-tree:
warning: srctree/ link to
include/linux/blk_mq.hdoes not exist
warning: srctree/ link toinclude/linux/drm/drm_gem.hdoes not
exist warning: srctree/ link toinclude/linux/drm/drm_drv.hdoes not exist warning: srctree/ link toinclude/linux/drm/drm_ioctl.hdoes not exist warning: srctree/ link toinclude/linux/drm/drm_file.hdoes not exist warning: srctree/ link toinclude/linux/drm/drm_device.hdoes not existInspired-by "Onur Özkan" <[email protected]>Signed-off-by Miguel Ojeda <[email protected]> ---rust/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)rust/Makefile +0
-0@@ -93,6 +93,12 @@ quiet_cmd_rustdoc = RUSTDOC $(if$(rustdoc_host),H, ) $< # and then retouch the generated files.
rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \
rustdoc-kernel rustdoc-pin_initrust/Makefile +1
-0+ $(Q)grep -Ehro '<a href="srctree/([^"]+)"' $(rustdoc_output)| \
rust/Makefile +3
-0+ cut -d'"' -f2 | cut -d/ -f2- | while read f; do \ + if [ ! -e "$(srctree)/$$f" ]; then \ + echo "warning: srctree/ link to $$fdoes not exist"; \
rust/Makefile +2
-0+ fi \ + done $(Q)cp $(srctree)/Documentation/images/logo.svg
Quoted 4 lines
$(rustdoc_output)/static.files/ $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output)/static.files/ $(Q)find $(rustdoc_output) -name '*.html' -type f -print0 | xargs -0 sed -Ei \
That's awesome! This would help a lot. :)
--
Regards,
Onur
Hi Miguel, this is indeed nice!
Quoted 24 lines · Miguel Ojeda
This fixes a handful of broken links and introduces a warning to prevent them from happening in the future.
Relatedly, we could also perhaps check the other side of the links, but perhaps there are cases we want to customize. Alternatively, we could also in the future introduce custom syntax for these that avoids repetition or a fancier preprocessing step.
Miguel Ojeda (3):
rust: block: fixsrctree/links
rust: drm: fixsrctree/links
rust: warn ifsrctree/links do not existrust/Makefile | 6 ++++++ rust/kernel/block/mq/gen_disk.rs | 2 +- rust/kernel/drm/device.rs | 2 +- rust/kernel/drm/driver.rs | 2 +- rust/kernel/drm/file.rs | 2 +- rust/kernel/drm/gem/mod.rs | 2 +- rust/kernel/drm/ioctl.rs | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-)
Quoted 2 lines
—
2.50.1
Patch 3 alone indeed produces the following warnings:
warning: srctree/ link to include/linux/blk_mq.h does not exist
warning: srctree/ link to include/linux/drm/drm_device.h does not exist
warning: srctree/ link to include/linux/drm/drm_ioctl.h does not exist
warning: srctree/ link to include/linux/drm/drm_file.h does not exist
warning: srctree/ link to include/linux/drm/drm_drv.h does not exist
warning: srctree/ link to include/linux/drm/drm_gem.h does not exist
So you can add my Tested-by for that one.
Cheers,
— Daniel
Miguel Ojeda
AppliedQuoted 3 lines · Miguel Ojeda
This fixes a handful of broken links and introduces a warning to prevent them from happening in the future.
Applied to rust-next -- thanks everyone!
I added Cc: [email protected] on the fixes.
Andreas/Boqun: if you don't want the block fix, please shout!
Cheers,
Miguel