Re: [PATCH] rust/fs: use intra-doc link for `EBADF` in `BadFdError` docs
From: Onur
Date: Tue Sep 16 2025 - 10:46:16 EST
Hi Tong,
On Tue, 16 Sep 2025 22:25:41 +0800
Tong <djfkvcing117@xxxxxxxxx> wrote:
> 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: https://github.com/onur-ozkan
> Link: https://github.com/Rust-for-Linux/linux/issues/1186
> Signed-off-by: Your Name <your.email@xxxxxxxxxxx>
This is wrong.
>
> ---
>
> From 676dd0d1d9276d5dd2a83469ac392732c0a1f34a Mon Sep 17 00:00:00 2001
> From: Webb321 <140618222+Webb321@xxxxxxxxxxxxxxxxxxxxxxxx>
> Date: Tue, 16 Sep 2025 22:15:25 +0800
> Subject: [PATCH] rust/fs: use intra-doc link for `EBADF` in
> `BadFdError` docs
>
> In `rust/kernel/fs/file.rs`, replace plain text `EBADF` references in
> the doc comment of `BadFdError` with intra-doc links [`EBADF`].
>
> 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: https://github.com/onur-ozkan
Should be: Suggested-by: Onur Özkan <work@xxxxxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1186
> Signed-off-by: djfkvcing117@xxxxxxxxx
> ---
> rust/kernel/fs/file.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/rust/kernel/fs/file.rs b/rust/kernel/fs/file.rs
> index 35fd5db35c4652..761a9074d65205 100644
> --- a/rust/kernel/fs/file.rs
> +++ b/rust/kernel/fs/file.rs
> @@ -447,7 +447,7 @@ impl Drop for FileDescriptorReservation { } }
> -/// Represents the `EBADF` error code.
> +/// Represents the [`EBADF`] error code.
> ///
> /// Used for methods that can only fail with `EBADF`.
You missed fixing the second `EBADF` here.
> #[derive(Copy, Clone, Eq, PartialEq)]
Thanks,
Onur