Skip to contentSkip to conversation

rust: block: fix formatting in GenDisk doc

PATCH Applied Yutaro Ohno 4 participants 8 messages Oct 23, 2024 – Dec 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: block: fix formatting in GenDisk doc

Align bullet points and improve indentation in the Invariants section of the GenDisk struct documentation for better readability.

Fixes 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")
---
 rust/kernel/block/mq/gen_disk.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
rust/kernel/block/mq/gen_disk.rs +3 -3
index 708125dce96a..c6df153ebb88 100644
@@ -174,9 +174,9 @@ pub fn build<T: Operations>(
 ///
 /// # Invariants
 ///
-///  - `gendisk` must always point to an initialized and valid `struct gendisk`.
-///  - `gendisk` was added to the VFS through a call to
-///     `bindings::device_add_disk`.
+/// - `gendisk` must always point to an initialized and valid `struct gendisk`.
+/// - `gendisk` was added to the VFS through a call to
+///   `bindings::device_add_disk`.
 pub struct GenDisk<T: Operations> {
     _tagset: Arc<TagSet<T>>,
     gendisk: *mut bindings::gendisk,
Signature · 1 line
2.47.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yutaro Ohno

Align bullet points and improve indentation in the Invariants section of the GenDisk struct documentation for better readability.

Fixes 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")

This looks good to me, but not sure we need a "Fixes:" tag, Miguel?

Regards,
Boqun

Quoted 24 lines
---
 rust/kernel/block/mq/gen_disk.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
rust/kernel/block/mq/gen_disk.rs +3 -3
index 708125dce96a..c6df153ebb88 100644
@@ -174,9 +174,9 @@ pub fn build<T: Operations>(
 ///
 /// # Invariants
 ///
-///  - `gendisk` must always point to an initialized and valid `struct gendisk`.
-///  - `gendisk` was added to the VFS through a call to
-///     `bindings::device_add_disk`.
+/// - `gendisk` must always point to an initialized and valid `struct gendisk`.
+/// - `gendisk` was added to the VFS through a call to
+///   `bindings::device_add_disk`.
 pub struct GenDisk<T: Operations> {
     _tagset: Arc<TagSet<T>>,
     gendisk: *mut bindings::gendisk,
Signature · 1 line
2.47.0
#2 lore raw
Quoted 2 lines · Boqun Feng

This looks good to me, but not sure we need a "Fixes:" tag, Miguel?

I think it is fine either way (it depends on who you ask).

Personally, I don't mind having it or not, but sometimes I may nevertheless take trivial fixes like this one through rust-next instead of rust-fixes.

Thanks!

Cheers,
Miguel

#3 lore raw
In reply to Yutaro Ohno
Quoted 6 lines · Yutaro Ohno

Align bullet points and improve indentation in the Invariants section of the GenDisk struct documentation for better readability.

Fixes 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")

Andreas: happy to apply this through rust-next if needed.

It would be good to have some automated checking on this, just like doc_lazy_continuation does, so I opened:

    https://github.com/rust-lang/rust-clippy/issues/13601

Cheers,
Miguel

#4 lore raw
Quoted 2 lines · Miguel Ojeda

Andreas: happy to apply this through rust-next if needed.

Ping -- do you want me to take it?

Thanks!

Cheers,
Miguel

maintainer
#5 lore raw
Quoted 6 lines · Miguel Ojeda
Quoted 2 lines · Miguel Ojeda

Andreas: happy to apply this through rust-next if needed.

Ping -- do you want me to take it?

Sure, go ahead 👍

Best regards,
Andreas Hindborg

maintainer Acked-by on v1 1/1
#6 lore raw
In reply to Yutaro Ohno
Quoted 16 lines · Yutaro Ohno

Align bullet points and improve indentation in the Invariants section of the GenDisk struct documentation for better readability.

Fixes 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")
---
 rust/kernel/block/mq/gen_disk.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
rust/kernel/block/mq/gen_disk.rs +0 -0
index 708125dce96a..c6df153ebb88 100644
@@ -174,9 +174,9 @@ pub fn build<T: Operations>(
 ///
 /// # Invariants

rust/kernel/block/mq/gen_disk.rs pub fn build<T: Operations>( · line 182

Quoted 10 lines
rust/kernel/block/mq/gen_disk.rs +3 -3
 ///
-///  - `gendisk` must always point to an initialized and valid `struct gendisk`.
-///  - `gendisk` was added to the VFS through a call to
-///     `bindings::device_add_disk`.
+/// - `gendisk` must always point to an initialized and valid `struct gendisk`.
+/// - `gendisk` was added to the VFS through a call to
+///   `bindings::device_add_disk`.
 pub struct GenDisk<T: Operations> {
     _tagset: Arc<TagSet<T>>,
     gendisk: *mut bindings::gendisk,

Best regards,
Andreas Hindborg

Applied
#7 lore raw
In reply to Yutaro Ohno
Quoted 6 lines · Yutaro Ohno

Align bullet points and improve indentation in the Invariants section of the GenDisk struct documentation for better readability.

Fixes 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")

Applied to rust-next -- thanks everyone!

[ Yutaro is also working on implementing the lint we suggested to catch
this sort of issue in upstream Rust:

https://github.com/rust-lang/rust-clippy/issues/13601
https://github.com/rust-lang/rust-clippy/pull/13711

Thanks a lot! - Miguel ]

Since it doesn't affect the rendered output as far as I can see and it is not really urgent, I have put it in -next. However, I kept the Fixes tag -- if https://github.com/rust-lang/rust-clippy/pull/13711
gets merged and we start using it, it may be an actual fix that could need to be backported eventually, so it doesn't hurt to keep it around, and if it gets autoselected, that is fine too.

Cheers,
Miguel