Thread (2 messages) 2 messages, 2 authors, 2025-09-16
STALE255d

[PATCH] rust/fs: use intra-doc link for `EBADF` in `BadFdError` docs

From: Tong <hidden>
Date: 2025-09-16 15:07:22
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), rust, the rest · Maintainers: Alexander Viro, Christian Brauner, Miguel Ojeda, Linus Torvalds

rust/fs: use intra-doc link for `EBADF` in `BadFdError` docs

This patch changes the documentation for `BadFdError` in the `fs`
module so that the error variant `EBADF` is referenced via an
intra-doc link (i.e., [`EBADF`]) rather than plain text. This improves
the generated documentation (so the `EBADF` constant is linked), and
helps tools like rust-analyzer to resolve the reference from the docs.

Testing:
- regenerated documentation, confirmed the link to `EBADF` shows up correctly,
- ran doctests to ensure no broken links in docs,
- built affected code with rustfmt / clippy to verify formatting and
lint cleanliness.

Suggested-by: Onur Özkan <redacted>
Link: https://github.com/Rust-for-Linux/linux/issues/1186
Signed-off-by: djfkvcing117@gmail.com

---

From 87d6b4e61da0db96a018b86baa011b9c6635e665 Mon Sep 17 00:00:00 2001
From: Webb321 <redacted>
Date: Tue, 16 Sep 2025 22:58:26 +0800
Subject: [PATCH] rust/fs: use intra-doc link for `EBADF` in `BadFdError` docs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In `rust/kernel/fs/file.rs`, replace plain text `EBADF` references in
the doc comment of `BadFdError` with intra-doc links [`EBADF`].
This improves the generated documentation (so the `EBADF` constant is
linked), and helps tools like rust-analyzer to resolve the reference
from the docs.

Testing:
- regenerated documentation, confirmed the link to `EBADF` shows up correctly,
- ran doctests to ensure no broken links in docs,
- built affected code with rustfmt / clippy to verify formatting and
lint cleanliness.

Suggested-by: Onur Özkan <redacted>
Link: https://github.com/Rust-for-Linux/linux/issues/1186

Signed-off-by: djfkvcing117@gmail.com
---
 rust/kernel/fs/file.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/fs/file.rs b/rust/kernel/fs/file.rs
index 67a3654f0fd370..f3153f4c8560bb 100644
--- a/rust/kernel/fs/file.rs
+++ b/rust/kernel/fs/file.rs
@@ -448,9 +448,9 @@ impl Drop for FileDescriptorReservation {
     }
 }

-/// Represents the `EBADF` error code.
+/// Represents the [`EBADF`] error code.
 ///
-/// Used for methods that can only fail with `EBADF`.
+/// Used for methods that can only fail with [`EBADF`].
 #[derive(Copy, Clone, Eq, PartialEq)]
 pub struct BadFdError;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help