All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] rust: use vertical import style and remove redundant imports
@ 2026-05-21  6:57 Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 1/7] rust: miscdevice: use vertical import style Alvin Sun
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Adopt the vertical import style and drop redundant imports already
re-exported via `kernel::prelude`.

Changes include:
- Convert use statements to vertical import style in miscdevice,
  samples, doctest, and block/mq
- Remove imports covered by prelude and apply minor formatting

Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
Changes in v3:
- Add trailing // to last items and closing braces in block/mq imports
- Add rnull vertical import style
- Add doctest vertical import style
- Link to v2: https://lore.kernel.org/r/20260520-miscdev-use-format-v2-0-64dc48fc1345@linux.dev

Changes in v2:
- Reformat use statements and drop redundant imports in
  rust/kernel/block/mq
- Drop redundant imports in rust/kernel/miscdevice
- Link to v1: https://lore.kernel.org/r/20260519-miscdev-use-format-v1-0-11d526ba0edc@linux.dev

---
Alvin Sun (7):
      rust: miscdevice: use vertical import style
      samples: rust_misc_device: use vertical import style
      rust: miscdevice: remove redundant imports
      rust: block: mq: use vertical import style
      rust: block: mq: remove redundant imports and format
      rust: block: rnull: use vertical import style
      rust: doctest: use vertical import style

 drivers/block/rnull/configfs.rs    | 27 +++++++++++++++++++++------
 drivers/block/rnull/rnull.rs       | 15 +++++++++++----
 rust/kernel/block/mq/gen_disk.rs   | 24 ++++++++++++++++++------
 rust/kernel/block/mq/operations.rs | 14 ++++++++++----
 rust/kernel/block/mq/request.rs    | 16 +++++++++++-----
 rust/kernel/block/mq/tag_set.rs    | 28 ++++++++++++++--------------
 rust/kernel/miscdevice.rs          | 23 +++++++++++++++++------
 samples/rust/rust_misc_device.rs   | 34 ++++++++++++++++++++++++++++------
 scripts/rustdoc_test_gen.rs        | 11 +++++++++--
 9 files changed, 139 insertions(+), 53 deletions(-)
---
base-commit: 5200f5f493f79f14bbdc349e402a40dfb32f23c8
change-id: 20260519-miscdev-use-format-9ab7e83b1c11

Best regards,
-- 
Alvin Sun <alvin.sun@linux.dev>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/7] rust: miscdevice: use vertical import style
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 2/7] samples: rust_misc_device: " Alvin Sun
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Convert `use` imports to vertical layout for better readability and
maintainability.

Reviewed-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 rust/kernel/miscdevice.rs | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index c3c2052c92069..05a6b6b9770f2 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -11,16 +11,38 @@
 use crate::{
     bindings,
     device::Device,
-    error::{to_result, Error, Result, VTABLE_DEFAULT_ERROR},
-    ffi::{c_int, c_long, c_uint, c_ulong},
-    fs::{File, Kiocb},
-    iov::{IovIterDest, IovIterSource},
+    error::{
+        to_result,
+        Error,
+        Result,
+        VTABLE_DEFAULT_ERROR, //
+    },
+    ffi::{
+        c_int,
+        c_long,
+        c_uint,
+        c_ulong, //
+    },
+    fs::{
+        File,
+        Kiocb, //
+    },
+    iov::{
+        IovIterDest,
+        IovIterSource, //
+    },
     mm::virt::VmaNew,
     prelude::*,
     seq_file::SeqFile,
-    types::{ForeignOwnable, Opaque},
+    types::{
+        ForeignOwnable,
+        Opaque, //
+    },
+};
+use core::{
+    marker::PhantomData,
+    pin::Pin, //
 };
-use core::{marker::PhantomData, pin::Pin};
 
 /// Options for creating a misc device.
 #[derive(Copy, Clone)]

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/7] samples: rust_misc_device: use vertical import style
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 1/7] rust: miscdevice: use vertical import style Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 3/7] rust: miscdevice: remove redundant imports Alvin Sun
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Convert `use` imports to vertical layout for better readability and
maintainability.

Reviewed-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 samples/rust/rust_misc_device.rs | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/samples/rust/rust_misc_device.rs b/samples/rust/rust_misc_device.rs
index 87a1fe63533ae..41e26c825060b 100644
--- a/samples/rust/rust_misc_device.rs
+++ b/samples/rust/rust_misc_device.rs
@@ -97,14 +97,36 @@
 
 use kernel::{
     device::Device,
-    fs::{File, Kiocb},
-    ioctl::{_IO, _IOC_SIZE, _IOR, _IOW},
-    iov::{IovIterDest, IovIterSource},
-    miscdevice::{MiscDevice, MiscDeviceOptions, MiscDeviceRegistration},
+    fs::{
+        File,
+        Kiocb, //
+    },
+    ioctl::{
+        _IO,
+        _IOC_SIZE,
+        _IOR,
+        _IOW, //
+    },
+    iov::{
+        IovIterDest,
+        IovIterSource, //
+    },
+    miscdevice::{
+        MiscDevice,
+        MiscDeviceOptions,
+        MiscDeviceRegistration, //
+    },
     new_mutex,
     prelude::*,
-    sync::{aref::ARef, Mutex},
-    uaccess::{UserSlice, UserSliceReader, UserSliceWriter},
+    sync::{
+        aref::ARef,
+        Mutex, //
+    },
+    uaccess::{
+        UserSlice,
+        UserSliceReader,
+        UserSliceWriter, //
+    },
 };
 
 const RUST_MISC_DEV_HELLO: u32 = _IO('|' as u32, 0x80);

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 3/7] rust: miscdevice: remove redundant imports
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 1/7] rust: miscdevice: use vertical import style Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 2/7] samples: rust_misc_device: " Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 4/7] rust: block: mq: use vertical import style Alvin Sun
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Drop `Error`, `Result`, `Pin`, `c_int`, `c_long`, `c_uint`, and
`c_ulong` imports already provided by `kernel::prelude`.

Reviewed-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 rust/kernel/miscdevice.rs | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 05a6b6b9770f2..83ce50def5ac9 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -13,16 +13,8 @@
     device::Device,
     error::{
         to_result,
-        Error,
-        Result,
         VTABLE_DEFAULT_ERROR, //
     },
-    ffi::{
-        c_int,
-        c_long,
-        c_uint,
-        c_ulong, //
-    },
     fs::{
         File,
         Kiocb, //
@@ -39,10 +31,7 @@
         Opaque, //
     },
 };
-use core::{
-    marker::PhantomData,
-    pin::Pin, //
-};
+use core::marker::PhantomData;
 
 /// Options for creating a misc device.
 #[derive(Copy, Clone)]

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 4/7] rust: block: mq: use vertical import style
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
                   ` (2 preceding siblings ...)
  2026-05-21  6:57 ` [PATCH v3 3/7] rust: miscdevice: remove redundant imports Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 5/7] rust: block: mq: remove redundant imports and format Alvin Sun
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Convert `use` imports to vertical layout for better readability and
maintainability.

Reviewed-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 rust/kernel/block/mq/gen_disk.rs   | 21 +++++++++++++++++----
 rust/kernel/block/mq/operations.rs | 17 +++++++++++++----
 rust/kernel/block/mq/request.rs    | 14 ++++++++++----
 rust/kernel/block/mq/tag_set.rs    | 24 +++++++++++++++++++-----
 4 files changed, 59 insertions(+), 17 deletions(-)

diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs
index 912cb805caf51..aac8ece10ae7c 100644
--- a/rust/kernel/block/mq/gen_disk.rs
+++ b/rust/kernel/block/mq/gen_disk.rs
@@ -7,14 +7,27 @@
 
 use crate::{
     bindings,
-    block::mq::{Operations, TagSet},
-    error::{self, from_err_ptr, Result},
-    fmt::{self, Write},
+    block::mq::{
+        Operations,
+        TagSet, //
+    },
+    error::{
+        self,
+        from_err_ptr,
+        Result, //
+    },
+    fmt::{
+        self,
+        Write, //
+    },
     prelude::*,
     static_lock_class,
     str::NullTerminatedFormatter,
     sync::Arc,
-    types::{ForeignOwnable, ScopeGuard},
+    types::{
+        ForeignOwnable,
+        ScopeGuard, //
+    }, //
 };
 
 /// A builder for [`GenDisk`].
diff --git a/rust/kernel/block/mq/operations.rs b/rust/kernel/block/mq/operations.rs
index 8ad46129a52c4..187b0b7791db9 100644
--- a/rust/kernel/block/mq/operations.rs
+++ b/rust/kernel/block/mq/operations.rs
@@ -6,11 +6,20 @@
 
 use crate::{
     bindings,
-    block::mq::{request::RequestDataWrapper, Request},
-    error::{from_result, Result},
+    block::mq::{
+        request::RequestDataWrapper,
+        Request, //
+    },
+    error::{
+        from_result,
+        Result, //
+    },
     prelude::*,
-    sync::{aref::ARef, Refcount},
-    types::ForeignOwnable,
+    sync::{
+        aref::ARef,
+        Refcount, //
+    },
+    types::ForeignOwnable, //
 };
 use core::marker::PhantomData;
 
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index ce3e30c81cb5e..66254d02bba65 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -9,13 +9,19 @@
     block::mq::Operations,
     error::Result,
     sync::{
-        aref::{ARef, AlwaysRefCounted},
+        aref::{
+            ARef,
+            AlwaysRefCounted, //
+        },
         atomic::Relaxed,
-        Refcount,
+        Refcount, //
     },
-    types::Opaque,
+    types::Opaque, //
+};
+use core::{
+    marker::PhantomData,
+    ptr::NonNull, //
 };
-use core::{marker::PhantomData, ptr::NonNull};
 
 /// A wrapper around a blk-mq [`struct request`]. This represents an IO request.
 ///
diff --git a/rust/kernel/block/mq/tag_set.rs b/rust/kernel/block/mq/tag_set.rs
index dae9df408a862..c1fd3e047af50 100644
--- a/rust/kernel/block/mq/tag_set.rs
+++ b/rust/kernel/block/mq/tag_set.rs
@@ -8,13 +8,27 @@
 
 use crate::{
     bindings,
-    block::mq::{operations::OperationsVTable, request::RequestDataWrapper, Operations},
-    error::{self, Result},
+    block::mq::{
+        operations::OperationsVTable,
+        request::RequestDataWrapper,
+        Operations, //
+    },
+    error::{
+        self,
+        Result, //
+    },
     prelude::try_pin_init,
-    types::Opaque,
+    types::Opaque, //
+};
+use core::{
+    convert::TryInto,
+    marker::PhantomData, //
+};
+use pin_init::{
+    pin_data,
+    pinned_drop,
+    PinInit, //
 };
-use core::{convert::TryInto, marker::PhantomData};
-use pin_init::{pin_data, pinned_drop, PinInit};
 
 /// A wrapper for the C `struct blk_mq_tag_set`.
 ///

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 5/7] rust: block: mq: remove redundant imports and format
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
                   ` (3 preceding siblings ...)
  2026-05-21  6:57 ` [PATCH v3 4/7] rust: block: mq: use vertical import style Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 6/7] rust: block: rnull: use vertical import style Alvin Sun
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun, Onur Özkan

Drop `Result`, `Pin`, `pin_data`, `pinned_drop`, `PinInit`, and
`try_pin_init` imports already provided by `kernel::prelude`.

Simplify `error` imports and flatten parameters formatting.

Reviewed-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 rust/kernel/block/mq/gen_disk.rs   |  7 +++----
 rust/kernel/block/mq/operations.rs |  5 +----
 rust/kernel/block/mq/request.rs    |  2 +-
 rust/kernel/block/mq/tag_set.rs    | 22 ++++------------------
 4 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs
index aac8ece10ae7c..b9653537cb44f 100644
--- a/rust/kernel/block/mq/gen_disk.rs
+++ b/rust/kernel/block/mq/gen_disk.rs
@@ -12,9 +12,8 @@
         TagSet, //
     },
     error::{
-        self,
         from_err_ptr,
-        Result, //
+        to_result, //
     },
     fmt::{
         self,
@@ -67,7 +66,7 @@ pub fn rotational(mut self, rotational: bool) -> Self {
     /// and that it is a power of two.
     pub fn validate_block_size(size: u32) -> Result {
         if !(512..=bindings::PAGE_SIZE as u32).contains(&size) || !size.is_power_of_two() {
-            Err(error::code::EINVAL)
+            Err(EINVAL)
         } else {
             Ok(())
         }
@@ -177,7 +176,7 @@ pub fn build<T: Operations>(
         // operation, so we will not race.
         unsafe { bindings::set_capacity(gendisk, self.capacity_sectors) };
 
-        crate::error::to_result(
+        to_result(
             // SAFETY: `gendisk` points to a valid and initialized instance of
             // `struct gendisk`.
             unsafe {
diff --git a/rust/kernel/block/mq/operations.rs b/rust/kernel/block/mq/operations.rs
index 187b0b7791db9..0343069b373c7 100644
--- a/rust/kernel/block/mq/operations.rs
+++ b/rust/kernel/block/mq/operations.rs
@@ -10,10 +10,7 @@
         request::RequestDataWrapper,
         Request, //
     },
-    error::{
-        from_result,
-        Result, //
-    },
+    error::from_result,
     prelude::*,
     sync::{
         aref::ARef,
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index 66254d02bba65..6115f9aec2285 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -7,7 +7,7 @@
 use crate::{
     bindings,
     block::mq::Operations,
-    error::Result,
+    prelude::*,
     sync::{
         aref::{
             ARef,
diff --git a/rust/kernel/block/mq/tag_set.rs b/rust/kernel/block/mq/tag_set.rs
index c1fd3e047af50..df3f90bfbb817 100644
--- a/rust/kernel/block/mq/tag_set.rs
+++ b/rust/kernel/block/mq/tag_set.rs
@@ -4,8 +4,6 @@
 //!
 //! C header: [`include/linux/blk-mq.h`](srctree/include/linux/blk-mq.h)
 
-use core::pin::Pin;
-
 use crate::{
     bindings,
     block::mq::{
@@ -13,22 +11,14 @@
         request::RequestDataWrapper,
         Operations, //
     },
-    error::{
-        self,
-        Result, //
-    },
-    prelude::try_pin_init,
+    error::to_result,
+    prelude::*,
     types::Opaque, //
 };
 use core::{
     convert::TryInto,
     marker::PhantomData, //
 };
-use pin_init::{
-    pin_data,
-    pinned_drop,
-    PinInit, //
-};
 
 /// A wrapper for the C `struct blk_mq_tag_set`.
 ///
@@ -47,11 +37,7 @@ pub struct TagSet<T: Operations> {
 
 impl<T: Operations> TagSet<T> {
     /// Try to create a new tag set
-    pub fn new(
-        nr_hw_queues: u32,
-        num_tags: u32,
-        num_maps: u32,
-    ) -> impl PinInit<Self, error::Error> {
+    pub fn new(nr_hw_queues: u32, num_tags: u32, num_maps: u32) -> impl PinInit<Self, Error> {
         let tag_set: bindings::blk_mq_tag_set = pin_init::zeroed();
         let tag_set: Result<_> = core::mem::size_of::<RequestDataWrapper>()
             .try_into()
@@ -77,7 +63,7 @@ pub fn new(
                 // SAFETY: we do not move out of `tag_set`.
                 let tag_set: &mut Opaque<_> = unsafe { Pin::get_unchecked_mut(tag_set) };
                 // SAFETY: `tag_set` is a reference to an initialized `blk_mq_tag_set`.
-                error::to_result( unsafe { bindings::blk_mq_alloc_tag_set(tag_set.get())})
+                to_result( unsafe { bindings::blk_mq_alloc_tag_set(tag_set.get())})
             }),
             _p: PhantomData,
         })

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 6/7] rust: block: rnull: use vertical import style
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
                   ` (4 preceding siblings ...)
  2026-05-21  6:57 ` [PATCH v3 5/7] rust: block: mq: remove redundant imports and format Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-21  6:57 ` [PATCH v3 7/7] rust: doctest: " Alvin Sun
  2026-05-25 17:51 ` [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Miguel Ojeda
  7 siblings, 0 replies; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun

Convert `use` imports to vertical layout for better readability and
maintainability.

Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 drivers/block/rnull/configfs.rs | 27 +++++++++++++++++++++------
 drivers/block/rnull/rnull.rs    | 15 +++++++++++----
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/drivers/block/rnull/configfs.rs b/drivers/block/rnull/configfs.rs
index 7c2eb5c0b7228..c10a55fc58948 100644
--- a/drivers/block/rnull/configfs.rs
+++ b/drivers/block/rnull/configfs.rs
@@ -1,16 +1,31 @@
 // SPDX-License-Identifier: GPL-2.0
 
-use super::{NullBlkDevice, THIS_MODULE};
+use super::{
+    NullBlkDevice,
+    THIS_MODULE, //
+};
 use kernel::{
-    block::mq::gen_disk::{GenDisk, GenDiskBuilder},
-    configfs::{self, AttributeOperations},
+    block::mq::gen_disk::{
+        GenDisk,
+        GenDiskBuilder, //
+    },
+    configfs::{
+        self,
+        AttributeOperations, //
+    },
     configfs_attrs,
-    fmt::{self, Write as _},
+    fmt::{
+        self,
+        Write as _, //
+    },
     new_mutex,
     page::PAGE_SIZE,
     prelude::*,
-    str::{kstrtobool_bytes, CString},
-    sync::Mutex,
+    str::{
+        kstrtobool_bytes,
+        CString, //
+    },
+    sync::Mutex, //
 };
 
 pub(crate) fn subsystem() -> impl PinInit<kernel::configfs::Subsystem<Config>, Error> {
diff --git a/drivers/block/rnull/rnull.rs b/drivers/block/rnull/rnull.rs
index 0ca8715febe83..13048cea8bb0d 100644
--- a/drivers/block/rnull/rnull.rs
+++ b/drivers/block/rnull/rnull.rs
@@ -10,12 +10,19 @@
         self,
         mq::{
             self,
-            gen_disk::{self, GenDisk},
-            Operations, TagSet,
-        },
+            gen_disk::{
+                self,
+                GenDisk, //
+            },
+            Operations,
+            TagSet, //
+        }, //
     },
     prelude::*,
-    sync::{aref::ARef, Arc},
+    sync::{
+        aref::ARef,
+        Arc, //
+    }, //
 };
 
 module! {

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 7/7] rust: doctest: use vertical import style
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
                   ` (5 preceding siblings ...)
  2026-05-21  6:57 ` [PATCH v3 6/7] rust: block: rnull: use vertical import style Alvin Sun
@ 2026-05-21  6:57 ` Alvin Sun
  2026-05-25 17:49   ` Miguel Ojeda
  2026-05-25 17:51 ` [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Miguel Ojeda
  7 siblings, 1 reply; 10+ messages in thread
From: Alvin Sun @ 2026-05-21  6:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar
  Cc: rust-for-linux, linux-block, linux-kselftest, kunit-dev,
	Alvin Sun

Convert `use` imports to vertical layout for better readability and
maintainability.

Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
 scripts/rustdoc_test_gen.rs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/rustdoc_test_gen.rs b/scripts/rustdoc_test_gen.rs
index d61a77219a8c2..ee76e96b41eea 100644
--- a/scripts/rustdoc_test_gen.rs
+++ b/scripts/rustdoc_test_gen.rs
@@ -31,8 +31,15 @@
 use std::{
     fs,
     fs::File,
-    io::{BufWriter, Read, Write},
-    path::{Path, PathBuf},
+    io::{
+        BufWriter,
+        Read,
+        Write, //
+    },
+    path::{
+        Path,
+        PathBuf, //
+    }, //
 };
 
 /// Find the real path to the original file based on the `file` portion of the test name.

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 7/7] rust: doctest: use vertical import style
  2026-05-21  6:57 ` [PATCH v3 7/7] rust: doctest: " Alvin Sun
@ 2026-05-25 17:49   ` Miguel Ojeda
  0 siblings, 0 replies; 10+ messages in thread
From: Miguel Ojeda @ 2026-05-25 17:49 UTC (permalink / raw)
  To: Alvin Sun
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar, rust-for-linux, linux-block,
	linux-kselftest, kunit-dev

On Thu, May 21, 2026 at 8:57 AM Alvin Sun <alvin.sun@linux.dev> wrote:
>
> Convert `use` imports to vertical layout for better readability and
> maintainability.
>
> Signed-off-by: Alvin Sun <alvin.sun@linux.dev>

Please check the titles used by previous commits for files, e.g.
"scripts: rust: " would probably be the prefix here. (No need to
resend just for this, maintainers may fix it on the fly).

The patch looks OK otherwise of course, thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] rust: use vertical import style and remove redundant imports
  2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
                   ` (6 preceding siblings ...)
  2026-05-21  6:57 ` [PATCH v3 7/7] rust: doctest: " Alvin Sun
@ 2026-05-25 17:51 ` Miguel Ojeda
  7 siblings, 0 replies; 10+ messages in thread
From: Miguel Ojeda @ 2026-05-25 17:51 UTC (permalink / raw)
  To: Alvin Sun
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Jens Axboe,
	Brendan Higgins, David Gow, Rae Moar, rust-for-linux, linux-block,
	linux-kselftest, kunit-dev, Onur Özkan

On Thu, May 21, 2026 at 8:57 AM Alvin Sun <alvin.sun@linux.dev> wrote:
>
> Adopt the vertical import style and drop redundant imports already
> re-exported via `kernel::prelude`.

I can take this if block and misc Ack. The changes are straightforward anyway.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-05-25 17:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21  6:57 [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Alvin Sun
2026-05-21  6:57 ` [PATCH v3 1/7] rust: miscdevice: use vertical import style Alvin Sun
2026-05-21  6:57 ` [PATCH v3 2/7] samples: rust_misc_device: " Alvin Sun
2026-05-21  6:57 ` [PATCH v3 3/7] rust: miscdevice: remove redundant imports Alvin Sun
2026-05-21  6:57 ` [PATCH v3 4/7] rust: block: mq: use vertical import style Alvin Sun
2026-05-21  6:57 ` [PATCH v3 5/7] rust: block: mq: remove redundant imports and format Alvin Sun
2026-05-21  6:57 ` [PATCH v3 6/7] rust: block: rnull: use vertical import style Alvin Sun
2026-05-21  6:57 ` [PATCH v3 7/7] rust: doctest: " Alvin Sun
2026-05-25 17:49   ` Miguel Ojeda
2026-05-25 17:51 ` [PATCH v3 0/7] rust: use vertical import style and remove redundant imports Miguel Ojeda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.