public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: gregkh@linuxfoundation.org, rafael@kernel.org, ojeda@kernel.org,
	boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com,
	lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com,
	tmgross@umich.edu, david.m.ertman@intel.com, ira.weiny@intel.com,
	leon@kernel.org
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-usb@vger.kernel.org, Danilo Krummrich <dakr@kernel.org>
Subject: [PATCH 4/5] rust: usb: use "kernel vertical" style for imports
Date: Mon,  5 Jan 2026 15:19:45 +0100	[thread overview]
Message-ID: <20260105142123.95030-4-dakr@kernel.org> (raw)
In-Reply-To: <20260105142123.95030-1-dakr@kernel.org>

Convert all imports to use "kernel vertical" style.

With this, subsequent patches neither introduce unrelated changes nor
leave an inconsistent import pattern.

While at it, drop unnecessary imports covered by prelude::*.

Link: https://docs.kernel.org/rust/coding-guidelines.html#imports
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
@Greg: If you agree I will take this through the driver-core tree. I will have
driver-core patches building on top of this.
---
 rust/kernel/usb.rs              | 21 +++++++++++++++------
 samples/rust/rust_driver_usb.rs | 10 +++++++++-
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/rust/kernel/usb.rs b/rust/kernel/usb.rs
index d10b65e9fb6a..99b07b5ac491 100644
--- a/rust/kernel/usb.rs
+++ b/rust/kernel/usb.rs
@@ -6,14 +6,23 @@
 //! C header: [`include/linux/usb.h`](srctree/include/linux/usb.h)
 
 use crate::{
-    bindings, device,
-    device_id::{RawDeviceId, RawDeviceIdIndex},
+    bindings,
+    device,
+    device_id::{
+        RawDeviceId,
+        RawDeviceIdIndex, //
+    },
     driver,
-    error::{from_result, to_result, Result},
+    error::{
+        from_result,
+        to_result, //
+    },
     prelude::*,
-    str::CStr,
-    types::{AlwaysRefCounted, Opaque},
-    ThisModule,
+    types::{
+        AlwaysRefCounted,
+        Opaque, //
+    },
+    ThisModule, //
 };
 use core::{
     marker::PhantomData,
diff --git a/samples/rust/rust_driver_usb.rs b/samples/rust/rust_driver_usb.rs
index 4eaad14867b2..ab72e99e1274 100644
--- a/samples/rust/rust_driver_usb.rs
+++ b/samples/rust/rust_driver_usb.rs
@@ -3,7 +3,15 @@
 
 //! Rust USB driver sample.
 
-use kernel::{device, device::Core, prelude::*, sync::aref::ARef, usb};
+use kernel::{
+    device::{
+        self,
+        Core, //
+    },
+    prelude::*,
+    sync::aref::ARef,
+    usb, //
+};
 
 struct SampleDriver {
     _intf: ARef<usb::Interface>,
-- 
2.52.0


  parent reply	other threads:[~2026-01-05 14:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 14:19 [PATCH 1/5] rust: auxiliary: use "kernel vertical" style for imports Danilo Krummrich
2026-01-05 14:19 ` [PATCH 2/5] rust: platform: " Danilo Krummrich
2026-01-07 15:09   ` Greg KH
2026-01-07 21:29   ` Danilo Krummrich
2026-01-05 14:19 ` [PATCH 3/5] rust: driver-core: " Danilo Krummrich
2026-01-07 15:09   ` Greg KH
2026-01-07 21:30   ` Danilo Krummrich
2026-01-05 14:19 ` Danilo Krummrich [this message]
2026-01-05 19:36   ` [PATCH 4/5] rust: usb: " Daniel Almeida
2026-01-05 23:41     ` Miguel Ojeda
2026-01-06 19:26   ` Danilo Krummrich
2026-01-07 15:09     ` Greg KH
2026-01-05 14:19 ` [PATCH 5/5] rust: faux: " Danilo Krummrich
2026-01-07 15:09   ` Greg KH
2026-01-07 21:30   ` Danilo Krummrich
2026-01-07 15:09 ` [PATCH 1/5] rust: auxiliary: " Greg KH
2026-01-07 21:29 ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260105142123.95030-4-dakr@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=david.m.ertman@intel.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox