[PATCH v3 2/7] samples: rust_misc_device: use vertical import style

0 views
Skip to first unread message

Alvin Sun

unread,
May 21, 2026, 2:57:16 AM (4 days ago) May 21
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, rust-fo...@vger.kernel.org, linux...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com, Alvin Sun, Onur Özkan
Convert `use` imports to vertical layout for better readability and
maintainability.

Reviewed-by: Onur Özkan <wo...@onurozkan.dev>
Signed-off-by: Alvin Sun <alvi...@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


Reply all
Reply to author
Forward
0 new messages