summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-12-18 17:56:11 +0100
committerDanilo Krummrich <dakr@kernel.org>2025-12-22 17:04:07 +0100
commit9202cef05d6b61a03475b744c7f0622cd8be8e90 (patch)
tree850479b0584be79302524094098f1ce7ad62a8a4 /samples
parent1b89d4a6bb4cd7cfd7eb2e3621f04fda956e4ef3 (diff)
rust: debugfs: use "kernel vertical" style for imports
Convert all imports in the debugfs Rust module 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 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/20251218165626.450264-1-dakr@kernel.org [ Apply the same change to the debugfs sample code. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/rust/rust_debugfs.rs32
-rw-r--r--samples/rust/rust_debugfs_scoped.rs21
2 files changed, 38 insertions, 15 deletions
diff --git a/samples/rust/rust_debugfs.rs b/samples/rust/rust_debugfs.rs
index 8d190952984f..3d6ad697e2b7 100644
--- a/samples/rust/rust_debugfs.rs
+++ b/samples/rust/rust_debugfs.rs
@@ -32,15 +32,29 @@
//! ```
use core::str::FromStr;
-use kernel::c_str;
-use kernel::debugfs::{Dir, File};
-use kernel::new_mutex;
-use kernel::prelude::*;
-use kernel::sizes::*;
-use kernel::sync::aref::ARef;
-use kernel::sync::atomic::{Atomic, Relaxed};
-use kernel::sync::Mutex;
-use kernel::{acpi, device::Core, of, platform, str::CString};
+use kernel::{
+ acpi,
+ c_str,
+ debugfs::{
+ Dir,
+ File, //
+ },
+ device::Core,
+ new_mutex,
+ of,
+ platform,
+ prelude::*,
+ sizes::*,
+ str::CString,
+ sync::{
+ aref::ARef,
+ atomic::{
+ Atomic,
+ Relaxed, //
+ },
+ Mutex,
+ }, //
+};
kernel::module_platform_driver! {
type: RustDebugFs,
diff --git a/samples/rust/rust_debugfs_scoped.rs b/samples/rust/rust_debugfs_scoped.rs
index 702a6546d3fb..cb5d3dfdc599 100644
--- a/samples/rust/rust_debugfs_scoped.rs
+++ b/samples/rust/rust_debugfs_scoped.rs
@@ -6,12 +6,21 @@
//! `Scope::dir` to create a variety of files without the need to separately
//! track them all.
-use kernel::debugfs::{Dir, Scope};
-use kernel::prelude::*;
-use kernel::sizes::*;
-use kernel::sync::atomic::Atomic;
-use kernel::sync::Mutex;
-use kernel::{c_str, new_mutex, str::CString};
+use kernel::{
+ c_str,
+ debugfs::{
+ Dir,
+ Scope, //
+ },
+ new_mutex,
+ prelude::*,
+ sizes::*,
+ str::CString,
+ sync::{
+ atomic::Atomic,
+ Mutex, //
+ },
+};
module! {
type: RustScopedDebugFs,