* [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting
@ 2024-09-09 16:17 hridesh
2024-09-09 19:21 ` Benno Lossin
2024-09-10 13:30 ` Miguel Ojeda
0 siblings, 2 replies; 4+ messages in thread
From: hridesh @ 2024-09-09 16:17 UTC (permalink / raw)
To: linux-block, rust-for-linux, linux-kernel
Cc: Andreas Hindborg, Boqun Feng, Miguel Ojeda, Alex Gaynor,
Wedson Almeida Filho, Gary Guo, 'Björn Roy Baron',
Benno Lossin, Alice Ryhl, Trevor Gross, Jens Axboe, hridesh,
Matt Gilbride, Shuah Khan
Remove unnecessary empty `\\\` lines in the rust docs. Also add linebreaks
in kernel::block::mq::Request to fix formatting
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: hridesh <hridesh699@gmail.com>
---
rust/kernel/block/mq/request.rs | 7 +++----
rust/kernel/rbtree.rs | 1 -
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index a0e22827f3f4..3ab2917c9d25 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -22,15 +22,14 @@
///
/// There are four states for a request that the Rust bindings care about:
///
-/// A) Request is owned by block layer (refcount 0)
+/// A) Request is owned by block layer (refcount 0)\
/// B) Request is owned by driver but with zero `ARef`s in existence
-/// (refcount 1)
+/// (refcount 1)\
/// C) Request is owned by driver with exactly one `ARef` in existence
-/// (refcount 2)
+/// (refcount 2)\
/// D) Request is owned by driver with more than one `ARef` in existence
/// (refcount > 2)
///
-///
/// We need to track A and B to ensure we fail tag to request conversions for
/// requests that are not owned by the driver.
///
diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs
index 25eb36fd1cdc..006f6e03aba5 100644
--- a/rust/kernel/rbtree.rs
+++ b/rust/kernel/rbtree.rs
@@ -1031,7 +1031,6 @@ fn next(&mut self) -> Option<Self::Item> {
/// A memory reservation for a red-black tree node.
///
-///
/// It contains the memory needed to hold a node that can be inserted into a red-black tree. One
/// can be obtained by directly allocating it ([`RBTreeNodeReservation::new`]).
pub struct RBTreeNodeReservation<K, V> {
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting
2024-09-09 16:17 [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting hridesh
@ 2024-09-09 19:21 ` Benno Lossin
2024-09-10 11:10 ` Miguel Ojeda
2024-09-10 13:30 ` Miguel Ojeda
1 sibling, 1 reply; 4+ messages in thread
From: Benno Lossin @ 2024-09-09 19:21 UTC (permalink / raw)
To: hridesh, linux-block, rust-for-linux, linux-kernel
Cc: Andreas Hindborg, Boqun Feng, Miguel Ojeda, Alex Gaynor,
Wedson Almeida Filho, Gary Guo, 'Björn Roy Baron',
Alice Ryhl, Trevor Gross, Jens Axboe, Matt Gilbride, Shuah Khan
Hi,
I see that this is your first kernel contribution, welcome!
I have left a couple comments below; before you send a new version,
please wait a couple days for other people to also leave their feedback.
You then create a new version (add `-v2` to `git format-patch`) and send
it to the list. You can put a changelog underneath the `---`, it will
not be included int the commit message, but for people reading the mail
it is rather helpful.
On 09.09.24 18:17, hridesh wrote:
> Remove unnecessary empty `\\\` lines in the rust docs. Also add linebreaks
You wrote backslashes here, but it should be forward slashes instead.
Please also fix it in the title.
I don't know if the commit title should start with `docs`, maybe we want
to do `rust: docs` when changing rustdocs? (This is a question to the
other Rust reviewers)
I think the title doesn't need to mention the exact cleanup, just
something along the lines "clean up docs" should suffice.
> in kernel::block::mq::Request to fix formatting
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1109
The issue also mentions that you should implement a `checkpatch.pl`
check in an additional patch:
> Clean up consecutive empty `///` lines and implement a checkpatch.pl
> check for it. These should be two different patches.
Please include that patch in your series.
> Signed-off-by: hridesh <hridesh699@gmail.com>
> ---
> rust/kernel/block/mq/request.rs | 7 +++----
> rust/kernel/rbtree.rs | 1 -
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
> index a0e22827f3f4..3ab2917c9d25 100644
> --- a/rust/kernel/block/mq/request.rs
> +++ b/rust/kernel/block/mq/request.rs
> @@ -22,15 +22,14 @@
> ///
> /// There are four states for a request that the Rust bindings care about:
> ///
> -/// A) Request is owned by block layer (refcount 0)
> +/// A) Request is owned by block layer (refcount 0)\
Instead of adding these backslashes, I personally would prefer if we
make this a normal markdown list using `1.`, `2.` etc.
Of course only if Andreas is OK with that though.
---
Cheers,
Benno
> /// B) Request is owned by driver but with zero `ARef`s in existence
> -/// (refcount 1)
> +/// (refcount 1)\
> /// C) Request is owned by driver with exactly one `ARef` in existence
> -/// (refcount 2)
> +/// (refcount 2)\
> /// D) Request is owned by driver with more than one `ARef` in existence
> /// (refcount > 2)
> ///
> -///
> /// We need to track A and B to ensure we fail tag to request conversions for
> /// requests that are not owned by the driver.
> ///
> diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs
> index 25eb36fd1cdc..006f6e03aba5 100644
> --- a/rust/kernel/rbtree.rs
> +++ b/rust/kernel/rbtree.rs
> @@ -1031,7 +1031,6 @@ fn next(&mut self) -> Option<Self::Item> {
>
> /// A memory reservation for a red-black tree node.
> ///
> -///
> /// It contains the memory needed to hold a node that can be inserted into a red-black tree. One
> /// can be obtained by directly allocating it ([`RBTreeNodeReservation::new`]).
> pub struct RBTreeNodeReservation<K, V> {
> --
> 2.46.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting
2024-09-09 19:21 ` Benno Lossin
@ 2024-09-10 11:10 ` Miguel Ojeda
0 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-09-10 11:10 UTC (permalink / raw)
To: Benno Lossin
Cc: hridesh, linux-block, rust-for-linux, linux-kernel,
Andreas Hindborg, Boqun Feng, Miguel Ojeda, Alex Gaynor,
Wedson Almeida Filho, Gary Guo, Björn Roy Baron, Alice Ryhl,
Trevor Gross, Jens Axboe, Matt Gilbride, Shuah Khan
On Mon, Sep 9, 2024 at 9:22 PM Benno Lossin <benno.lossin@proton.me> wrote:
>
> I don't know if the commit title should start with `docs`, maybe we want
> to do `rust: docs` when changing rustdocs? (This is a question to the
> other Rust reviewers)
>
> I think the title doesn't need to mention the exact cleanup, just
> something along the lines "clean up docs" should suffice.
Yeah, "docs" would be better for Documentation/ bits.
I think something like this would be ideal:
rust: kernel: clean up empty `\\\` lines
> Instead of adding these backslashes, I personally would prefer if we
Yeah, we have another patch on the list for that, so I would remove it
from this one.
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting
2024-09-09 16:17 [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting hridesh
2024-09-09 19:21 ` Benno Lossin
@ 2024-09-10 13:30 ` Miguel Ojeda
1 sibling, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-09-10 13:30 UTC (permalink / raw)
To: hridesh
Cc: linux-block, rust-for-linux, linux-kernel, Andreas Hindborg,
Boqun Feng, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
Gary Guo, Björn Roy Baron, Benno Lossin, Alice Ryhl,
Trevor Gross, Jens Axboe, Matt Gilbride, Shuah Khan
On Mon, Sep 9, 2024 at 6:19 PM hridesh <hridesh699@gmail.com> wrote:
>
> Signed-off-by: hridesh <hridesh699@gmail.com>
Is hridesh a "known identity"? If not, please use your full legal name
(please see https://docs.kernel.org/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin).
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-10 13:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 16:17 [PATCH] docs: rust: clean up empty `\\\` lines and improve rustdoc formatting hridesh
2024-09-09 19:21 ` Benno Lossin
2024-09-10 11:10 ` Miguel Ojeda
2024-09-10 13:30 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox