[PATCH] rust: file: add intra-doc link for 'EBADF'

djfkvcing117@gmail.com posted 1 patch 2 months, 2 weeks ago
There is a newer version of this series
rust/kernel/fs/file.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] rust: file: add intra-doc link for 'EBADF'
Posted by djfkvcing117@gmail.com 2 months, 2 weeks ago
From: Tong Li <djfkvcing117@gmail.com>

Suggested-by: Onur Özkan <work@onurozkan.dev>
Link: https://github.com/Rust-for-Linux/linux/issues/1186
Signed-off-by: Tong Li <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 67a3654f0fd3..f3153f4c8560 100644
--- a/rust/kernel/fs/file.rs
+++ b/rust/kernel/fs/file.rs
@@ -448,9 +448,9 @@ fn drop(&mut self) {
     }
 }
 
-/// 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;
 
-- 
2.51.0

Re: [PATCH] rust: file: add intra-doc link for 'EBADF'
Posted by Miguel Ojeda 2 months, 2 weeks ago
On Tue, Sep 30, 2025 at 11:27 AM <djfkvcing117@gmail.com> wrote:
>
> From: Tong Li <djfkvcing117@gmail.com>
>
> Suggested-by: Onur Özkan <work@onurozkan.dev>
> Link: https://github.com/Rust-for-Linux/linux/issues/1186
> Signed-off-by: Tong Li <djfkvcing117@gmail.com>

Normally commits cannot have an empty message -- this one is trivial,
so it is not a big deal, but maintainers in general may complain. Up
to them, of course.

What you should normally do is explain the "why" of a change, i.e. why
we want to add an intra-doc link, its benefits.

Other than that, it seems like the formatting is good. If you fix the
From: header, then the From: line in the body is not needed and Git
should not add it anymore, but it is not a blocker.

Thanks!

Cheers,
Miguel
[PATCH v2] rust: file: add intra-doc link for 'EBADF'
Posted by Tong Li 2 months, 2 weeks ago
The `BadFdError` doc comment mentions the `EBADF` constant but does
not currently provide a navigation target for readers of the
generated docs. Turning the references into intra-doc links matches
the rest of the module and makes the documentation easier to
explore.

Suggested-by: Onur Özkan <work@onurozkan.dev>
Link: https://github.com/Rust-for-Linux/linux/issues/1186
Signed-off-by: Tong Li <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 67a3654f0fd3..f3153f4c8560 100644
--- a/rust/kernel/fs/file.rs
+++ b/rust/kernel/fs/file.rs
@@ -448,9 +448,9 @@ fn drop(&mut self) {
     }
 }
 
-/// 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;
 
-- 
2.51.0

Re: [PATCH v2] rust: file: add intra-doc link for 'EBADF'
Posted by Christian Brauner 2 months, 1 week ago
On Tue, 30 Sep 2025 19:02:58 +0800, Tong Li wrote:
> The `BadFdError` doc comment mentions the `EBADF` constant but does
> not currently provide a navigation target for readers of the
> generated docs. Turning the references into intra-doc links matches
> the rest of the module and makes the documentation easier to
> explore.
> 
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] rust: file: add intra-doc link for 'EBADF'
      https://git.kernel.org/vfs/vfs/c/2b0b5bcc45a0