* [PATCH v2 1/2] rust: kernel: clean up empty `///` lines
@ 2024-09-11 17:44 Hridesh MG
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-11 17:44 UTC (permalink / raw)
To: rust-for-linux, linux-kernel
Cc: hridesh, 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
From: hridesh <hridesh699@gmail.com>
Remove unnecessary empty `///` lines in the rust docs.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
Changes in v2:
- Fixed typo in commit title and description
- Removed backslashes in kernel::block::mq::Request
- Link to v1: https://lore.kernel.org/rust-for-linux/20240909161749.147076-1-hridesh699@gmail.com/
Huge thanks to Benno Lossin and Miguel Ojeda for taking the time to
review my first patch
---
rust/kernel/block/mq/request.rs | 1 -
rust/kernel/rbtree.rs | 1 -
2 files changed, 2 deletions(-)
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index a0e22827f3f4..313334b1bf18 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -30,7 +30,6 @@
/// 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] 10+ messages in thread
* [PATCH v2 2/2] checkpatch: warn on empty rust doc comments
2024-09-11 17:44 [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Hridesh MG
@ 2024-09-11 17:44 ` Hridesh MG
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
2024-09-14 15:31 ` Hridesh MG
2024-09-12 5:13 ` [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Greg KH
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-11 17:44 UTC (permalink / raw)
To: linux-kernel, rust-for-linux
Cc: hridesh, Andy Whitcroft, Joe Perches, Dwaipayan Ray,
Lukas Bulwahn, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Shuah Khan
From: hridesh <hridesh699@gmail.com>
Add a check to warn if there are consecutive empty `///` lines in rust
files.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
No changes in v2, this is a new patch
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 39032224d504..c75bc3927bf6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3884,6 +3884,13 @@ sub process {
}
}
+# check for consecutive empty /// lines in .rs files
+ if ($realfile =~ /\.rs$/ &&
+ $rawline =~ /^\+\s*\/\/\/$/ && $prevrawline =~ /^\+\s*\/\/\/$/) {
+ WARN("RUST_DOC_EMPTY",
+ "avoid using consecutive empty rustdoc comments\n" . $herecurr);
+ }
+
# check for adding lines without a newline.
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
if (WARN("MISSING_EOF_NEWLINE",
--
2.46.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] rust: kernel: clean up empty `///` lines
2024-09-11 17:44 [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Hridesh MG
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
@ 2024-09-12 5:13 ` Greg KH
2024-09-12 11:46 ` Hridesh MG
2024-09-12 11:50 ` Alice Ryhl
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
3 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2024-09-12 5:13 UTC (permalink / raw)
To: Hridesh MG
Cc: 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 Wed, Sep 11, 2024 at 11:14:34PM +0530, Hridesh MG wrote:
> From: hridesh <hridesh699@gmail.com>
>
> Remove unnecessary empty `///` lines in the rust docs.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1109
> Signed-off-by: Hridesh MG <hridesh699@gmail.com>
This name needs to match your "From:" line, sorry. Can you fix that up
and send a v3 series?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] rust: kernel: clean up empty `///` lines
2024-09-12 5:13 ` [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Greg KH
@ 2024-09-12 11:46 ` Hridesh MG
0 siblings, 0 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-12 11:46 UTC (permalink / raw)
To: Greg KH
Cc: 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 Thu, Sep 12, 2024 at 10:43 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Sep 11, 2024 at 11:14:34PM +0530, Hridesh MG wrote:
> > From: hridesh <hridesh699@gmail.com>
> >
> > Remove unnecessary empty `///` lines in the rust docs.
> >
>
> This name needs to match your "From:" line, sorry. Can you fix that up
> and send a v3 series?
Sorry, that was an oversight on my side. I'll wait a few days before
sending v3 in case there is more feedback.
--
Best Regards,
Hridesh
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] rust: kernel: clean up empty `///` lines
2024-09-11 17:44 [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Hridesh MG
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
2024-09-12 5:13 ` [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Greg KH
@ 2024-09-12 11:50 ` Alice Ryhl
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
3 siblings, 0 replies; 10+ messages in thread
From: Alice Ryhl @ 2024-09-12 11:50 UTC (permalink / raw)
To: Hridesh MG
Cc: rust-for-linux, linux-kernel, Andreas Hindborg, Boqun Feng,
Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Gary Guo,
Björn Roy Baron, Benno Lossin, Trevor Gross, Jens Axboe,
Matt Gilbride, Shuah Khan
On Wed, Sep 11, 2024 at 7:45 PM Hridesh MG <hridesh699@gmail.com> wrote:
>
> From: hridesh <hridesh699@gmail.com>
>
> Remove unnecessary empty `///` lines in the rust docs.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1109
> Signed-off-by: Hridesh MG <hridesh699@gmail.com>
Other than what Greg mentioned, looks good to me.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/2] rust: kernel: clean up empty `///` lines
2024-09-11 17:44 [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Hridesh MG
` (2 preceding siblings ...)
2024-09-12 11:50 ` Alice Ryhl
@ 2024-09-14 15:24 ` Hridesh MG
3 siblings, 0 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-14 15:24 UTC (permalink / raw)
To: rust-for-linux, linux-kernel
Cc: Hridesh MG, 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
Remove unnecessary empty `///` lines in the rust docs.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
Changes in v2:
- Fixed typo in commit title and description
- Removed backslashes in kernel::block::mq::Request
- Link to v1: https://lore.kernel.org/rust-for-linux/20240909161749.147076-1-hridesh699@gmail.com/
Changes in v3:
- Fixed From: tag in patch header
---
rust/kernel/block/mq/request.rs | 1 -
rust/kernel/rbtree.rs | 1 -
2 files changed, 2 deletions(-)
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index a0e22827f3f4..313334b1bf18 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -30,7 +30,6 @@
/// 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] 10+ messages in thread
* [PATCH v3 2/2] checkpatch: warn on empty rust doc comments
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
@ 2024-09-14 15:24 ` Hridesh MG
2024-09-14 15:31 ` Hridesh MG
1 sibling, 0 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-14 15:24 UTC (permalink / raw)
To: linux-kernel, rust-for-linux
Cc: Hridesh MG, Andy Whitcroft, Joe Perches, Dwaipayan Ray,
Lukas Bulwahn, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Shuah Khan
Add a check to warn if there are consecutive empty `///` lines in rust
files.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
No changes in v2, this is a new patch
No changes in v3
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 39032224d504..c75bc3927bf6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3884,6 +3884,13 @@ sub process {
}
}
+# check for consecutive empty /// lines in .rs files
+ if ($realfile =~ /\.rs$/ &&
+ $rawline =~ /^\+\s*\/\/\/$/ && $prevrawline =~ /^\+\s*\/\/\/$/) {
+ WARN("RUST_DOC_EMPTY",
+ "avoid using consecutive empty rustdoc comments\n" . $herecurr);
+ }
+
# check for adding lines without a newline.
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
if (WARN("MISSING_EOF_NEWLINE",
--
2.46.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] checkpatch: warn on empty rust doc comments
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
@ 2024-09-14 15:31 ` Hridesh MG
2024-09-14 16:42 ` Gary Guo
1 sibling, 1 reply; 10+ messages in thread
From: Hridesh MG @ 2024-09-14 15:31 UTC (permalink / raw)
To: linux-kernel, rust-for-linux
Cc: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn,
Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Shuah Khan
Ah, sorry. I did not intend to post this version as a reply to the
previous thread, I wrongly assumed that editing the patch manually
wouldn't have side effects. Should I post it again or is this fine?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] checkpatch: warn on empty rust doc comments
2024-09-14 15:31 ` Hridesh MG
@ 2024-09-14 16:42 ` Gary Guo
2024-09-14 16:57 ` Hridesh MG
0 siblings, 1 reply; 10+ messages in thread
From: Gary Guo @ 2024-09-14 16:42 UTC (permalink / raw)
To: Hridesh MG
Cc: linux-kernel, rust-for-linux, Andy Whitcroft, Joe Perches,
Dwaipayan Ray, Lukas Bulwahn, Miguel Ojeda, Alex Gaynor,
Wedson Almeida Filho, Boqun Feng, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Shuah Khan
On Sat, 14 Sep 2024 21:01:24 +0530
Hridesh MG <hridesh699@gmail.com> wrote:
> Ah, sorry. I did not intend to post this version as a reply to the
> previous thread, I wrongly assumed that editing the patch manually
> wouldn't have side effects. Should I post it again or is this fine?
I don't know what happened, somehow in my email client I saw the old
replies to your v2 patch becomes reply to your v3 patch.
Did you somehow reuse Message-ID between v3 and v2? Not sure how that's
supposed to happen...
Best,
Gary
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] checkpatch: warn on empty rust doc comments
2024-09-14 16:42 ` Gary Guo
@ 2024-09-14 16:57 ` Hridesh MG
0 siblings, 0 replies; 10+ messages in thread
From: Hridesh MG @ 2024-09-14 16:57 UTC (permalink / raw)
To: Gary Guo
Cc: linux-kernel, rust-for-linux, Andy Whitcroft, Joe Perches,
Dwaipayan Ray, Lukas Bulwahn, Miguel Ojeda, Alex Gaynor,
Wedson Almeida Filho, Boqun Feng, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Shuah Khan
On Sat, Sep 14, 2024 at 10:12 PM Gary Guo <gary@garyguo.net> wrote:
>
> On Sat, 14 Sep 2024 21:01:24 +0530
> Hridesh MG <hridesh699@gmail.com> wrote:
>
> > Ah, sorry. I did not intend to post this version as a reply to the
> > previous thread, I wrongly assumed that editing the patch manually
> > wouldn't have side effects. Should I post it again or is this fine?
>
> I don't know what happened, somehow in my email client I saw the old
> replies to your v2 patch becomes reply to your v3 patch.
>
> Did you somehow reuse Message-ID between v3 and v2? Not sure how that's
> supposed to happen...
>
> Best,
> Gary
Yeah, I did not run git format-patch again to create v3. That messed
everything up.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-09-14 16:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 17:44 [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Hridesh MG
2024-09-11 17:44 ` [PATCH v2 2/2] checkpatch: warn on empty rust doc comments Hridesh MG
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
2024-09-14 15:31 ` Hridesh MG
2024-09-14 16:42 ` Gary Guo
2024-09-14 16:57 ` Hridesh MG
2024-09-12 5:13 ` [PATCH v2 1/2] rust: kernel: clean up empty `///` lines Greg KH
2024-09-12 11:46 ` Hridesh MG
2024-09-12 11:50 ` Alice Ryhl
2024-09-14 15:24 ` [PATCH v3 " Hridesh MG
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).