Re: [PATCH] rust: debugfs: use "kernel vertical" style for imports
From: Greg KH
Date: Sat Dec 20 2025 - 03:40:44 EST
On Thu, Dec 18, 2025 at 05:56:11PM +0100, Danilo Krummrich wrote:
> 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
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> ---
> rust/kernel/debugfs.rs | 46 ++++++++++++++++++------
> rust/kernel/debugfs/callback_adapters.rs | 21 +++++++----
> rust/kernel/debugfs/entry.rs | 14 +++++---
> rust/kernel/debugfs/file_ops.rs | 25 ++++++++-----
> rust/kernel/debugfs/traits.rs | 43 ++++++++++++++++------
> 5 files changed, 109 insertions(+), 40 deletions(-)
>
> diff --git a/rust/kernel/debugfs.rs b/rust/kernel/debugfs.rs
> index facad81e8290..536a320334bf 100644
> --- a/rust/kernel/debugfs.rs
> +++ b/rust/kernel/debugfs.rs
> @@ -8,28 +8,52 @@
> // When DebugFS is disabled, many parameters are dead. Linting for this isn't helpful.
> #![cfg_attr(not(CONFIG_DEBUG_FS), allow(unused_variables))]
>
> -use crate::fmt;
> -use crate::prelude::*;
> -use crate::str::CStr;
> #[cfg(CONFIG_DEBUG_FS)]
> use crate::sync::Arc;
> -use crate::uaccess::UserSliceReader;
> -use core::marker::PhantomData;
> -use core::marker::PhantomPinned;
> +use crate::{
> + fmt,
> + prelude::*,
> + str::CStr,
> + uaccess::UserSliceReader, //
While I hate the // use here, I have hope that one day the compiler will
be fixed to allow this...
Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>