lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D5B126F1-B6F5-410F-9BE9-FA688C990A10@collabora.com>
Date: Mon, 5 Jan 2026 16:36:17 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: gregkh@...uxfoundation.org,
 rafael@...nel.org,
 ojeda@...nel.org,
 boqun.feng@...il.com,
 gary@...yguo.net,
 bjorn3_gh@...tonmail.com,
 lossin@...nel.org,
 a.hindborg@...nel.org,
 aliceryhl@...gle.com,
 tmgross@...ch.edu,
 david.m.ertman@...el.com,
 ira.weiny@...el.com,
 leon@...nel.org,
 linux-kernel@...r.kernel.org,
 rust-for-linux@...r.kernel.org,
 linux-usb@...r.kernel.org
Subject: Re: [PATCH 4/5] rust: usb: use "kernel vertical" style for imports



> On 5 Jan 2026, at 11:19, Danilo Krummrich <dakr@...nel.org> wrote:
> 
> 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@...nel.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
> 
> 

OOC: can rustfmt do this, or is it a manual process for the time being?

Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ