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 2/5] rust: platform: use "kernel vertical" style for imports
Date: Mon, 5 Jan 2026 15:19:43 +0100 [thread overview]
Message-ID: <20260105142123.95030-2-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>
---
rust/kernel/platform.rs | 31 +++++++++++++++++++++-------
samples/rust/rust_driver_platform.rs | 10 ++++++---
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs
index bddb593cee7b..8836ac46b066 100644
--- a/rust/kernel/platform.rs
+++ b/rust/kernel/platform.rs
@@ -5,22 +5,39 @@
//! C header: [`include/linux/platform_device.h`](srctree/include/linux/platform_device.h)
use crate::{
- acpi, bindings, container_of,
- device::{self, Bound},
+ acpi,
+ bindings,
+ container_of,
+ device::{
+ self,
+ Bound, //
+ },
driver,
- error::{from_result, to_result, Result},
- io::{mem::IoRequest, Resource},
- irq::{self, IrqRequest},
+ error::{
+ from_result,
+ to_result, //
+ },
+ io::{
+ mem::IoRequest,
+ Resource, //
+ },
+ irq::{
+ self,
+ IrqRequest, //
+ },
of,
prelude::*,
types::Opaque,
- ThisModule,
+ ThisModule, //
};
use core::{
marker::PhantomData,
mem::offset_of,
- ptr::{addr_of_mut, NonNull},
+ ptr::{
+ addr_of_mut,
+ NonNull, //
+ },
};
/// An adapter for the registration of platform drivers.
diff --git a/samples/rust/rust_driver_platform.rs b/samples/rust/rust_driver_platform.rs
index a3044d773176..9537dc38c563 100644
--- a/samples/rust/rust_driver_platform.rs
+++ b/samples/rust/rust_driver_platform.rs
@@ -66,13 +66,17 @@
acpi,
device::{
self,
- property::{FwNodeReferenceArgs, NArgs},
+ property::{
+ FwNodeReferenceArgs,
+ NArgs, //
+ },
Core,
},
- of, platform,
+ of,
+ platform,
prelude::*,
str::CString,
- sync::aref::ARef,
+ sync::aref::ARef, //
};
struct SampleDriver {
--
2.52.0
next prev 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 ` Danilo Krummrich [this message]
2026-01-07 15:09 ` [PATCH 2/5] rust: platform: " 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 ` [PATCH 4/5] rust: usb: " Danilo Krummrich
2026-01-05 19:36 ` 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-2-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