Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: driver-core: use "kernel vertical" style for imports

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
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20260105142123.95030-3-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

+38 -13
+11 -3
rust/kernel/device.rs
··· 5 5 //! C header: [`include/linux/device.h`](srctree/include/linux/device.h) 6 6 7 7 use crate::{ 8 - bindings, fmt, 8 + bindings, 9 + fmt, 9 10 prelude::*, 10 11 sync::aref::ARef, 11 - types::{ForeignOwnable, Opaque}, 12 + types::{ 13 + ForeignOwnable, 14 + Opaque, // 15 + }, // 12 16 }; 13 - use core::{any::TypeId, marker::PhantomData, ptr}; 17 + use core::{ 18 + any::TypeId, 19 + marker::PhantomData, 20 + ptr, // 21 + }; 14 22 15 23 use crate::str::CStrExt as _; 16 24
+19 -6
rust/kernel/devres.rs
··· 8 8 use crate::{ 9 9 alloc::Flags, 10 10 bindings, 11 - device::{Bound, Device}, 12 - error::{to_result, Error, Result}, 13 - ffi::c_void, 11 + device::{ 12 + Bound, 13 + Device, // 14 + }, 15 + error::to_result, 14 16 prelude::*, 15 - revocable::{Revocable, RevocableGuard}, 16 - sync::{aref::ARef, rcu, Completion}, 17 - types::{ForeignOwnable, Opaque, ScopeGuard}, 17 + revocable::{ 18 + Revocable, 19 + RevocableGuard, // 20 + }, 21 + sync::{ 22 + aref::ARef, 23 + rcu, 24 + Completion, // 25 + }, 26 + types::{ 27 + ForeignOwnable, 28 + Opaque, 29 + ScopeGuard, // 30 + }, 18 31 }; 19 32 20 33 use pin_init::Wrapper;
+8 -4
rust/kernel/driver.rs
··· 90 90 //! [`pci::Driver`]: kernel::pci::Driver 91 91 //! [`platform::Driver`]: kernel::platform::Driver 92 92 93 - use crate::error::{Error, Result}; 94 - use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule}; 95 - use core::pin::Pin; 96 - use pin_init::{pin_data, pinned_drop, PinInit}; 93 + use crate::{ 94 + acpi, 95 + device, 96 + of, 97 + prelude::*, 98 + types::Opaque, 99 + ThisModule, // 100 + }; 97 101 98 102 /// The [`RegistrationOps`] trait serves as generic interface for subsystems (e.g., PCI, Platform, 99 103 /// Amba, etc.) to provide the corresponding subsystem specific implementation to register /