From: "Gary Guo" <gary@garyguo.net>
To: "Lyude Paul" <lyude@redhat.com>, <linux-kernel@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>
Cc: "Ewan Chorynski" <ewan.chorynski@ik.me>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Shankari Anand" <shankari.ak0208@gmail.com>,
"David Airlie" <airlied@gmail.com>,
"Atharv Dubey" <atharvd440@gmail.com>,
"Asahi Lina" <lina+kernel@asahilina.net>,
"Daniel Almeida" <daniel.almeida@collabora.com>
Subject: Re: [PATCH v2 1/2] rust/drm: Fixup import styles
Date: Thu, 22 Jan 2026 23:04:06 +0000 [thread overview]
Message-ID: <DFVHS3VVR2NL.25TRT6CK2EBB3@garyguo.net> (raw)
In-Reply-To: <20260122214316.3281257-1-lyude@redhat.com>
On Thu Jan 22, 2026 at 9:43 PM GMT, Lyude Paul wrote:
> This is to match
> https://docs.kernel.org/rust/coding-guidelines.html#imports
>
> There should be no functional changes in this patch.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
> rust/kernel/drm/device.rs | 29 +++++++++++++++++++++++------
> rust/kernel/drm/driver.rs | 10 ++++++++--
> rust/kernel/drm/file.rs | 14 +++++++++++---
> rust/kernel/drm/gem/mod.rs | 25 ++++++++++++++++++++-----
> 4 files changed, 62 insertions(+), 16 deletions(-)
>
> diff --git a/rust/kernel/drm/device.rs b/rust/kernel/drm/device.rs
> index 3ce8f62a00569..23c457c90a6ab 100644
> --- a/rust/kernel/drm/device.rs
> +++ b/rust/kernel/drm/device.rs
> @@ -6,15 +6,32 @@
>
> use crate::{
> alloc::allocator::Kmalloc,
> - bindings, device, drm,
> - drm::driver::AllocImpl,
> - error::from_err_ptr,
> - error::Result,
> + bindings,
> + device, //
I think this // is supposed to go to the last item in the import?
Best,
Gary
> + drm::{
> + self,
> + driver::AllocImpl, //
> + },
> + error::{
> + from_err_ptr,
> + Result, //
> + },
> prelude::*,
> - sync::aref::{ARef, AlwaysRefCounted},
> + sync::aref::{
> + ARef,
> + AlwaysRefCounted, //
> + },
> types::Opaque,
> };
> -use core::{alloc::Layout, mem, ops::Deref, ptr, ptr::NonNull};
> +use core::{
> + alloc::Layout,
> + mem,
> + ops::Deref,
> + ptr::{
> + self,
> + NonNull, //
> + },
> +};
>
> #[cfg(CONFIG_DRM_LEGACY)]
> macro_rules! drm_legacy_fields {
> diff --git a/rust/kernel/drm/driver.rs b/rust/kernel/drm/driver.rs
> index f30ee4c6245cd..c8ec5c0819a06 100644
> --- a/rust/kernel/drm/driver.rs
> +++ b/rust/kernel/drm/driver.rs
> @@ -5,8 +5,14 @@
> //! C header: [`include/drm/drm_drv.h`](srctree/include/drm/drm_drv.h)
>
> use crate::{
> - bindings, device, devres, drm,
> - error::{to_result, Result},
> + bindings,
> + device,
> + devres,
> + drm, //
> + error::{
> + to_result,
> + Result, //
> + },
> prelude::*,
> sync::aref::ARef,
> };
> diff --git a/rust/kernel/drm/file.rs b/rust/kernel/drm/file.rs
> index 8c46f8d519516..7dade6dfa1ba2 100644
> --- a/rust/kernel/drm/file.rs
> +++ b/rust/kernel/drm/file.rs
> @@ -4,9 +4,17 @@
> //!
> //! C header: [`include/drm/drm_file.h`](srctree/include/drm/drm_file.h)
>
> -use crate::{bindings, drm, error::Result, prelude::*, types::Opaque};
> -use core::marker::PhantomData;
> -use core::pin::Pin;
> +use crate::{
> + bindings,
> + drm,
> + error::Result,
> + prelude::*,
> + types::Opaque, //
> +};
> +use core::{
> + marker::PhantomData,
> + pin::Pin, //
> +};
>
> /// Trait that must be implemented by DRM drivers to represent a DRM File (a client instance).
> pub trait DriverFile {
> diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
> index d49a9ba026356..56b7641b1405e 100644
> --- a/rust/kernel/drm/gem/mod.rs
> +++ b/rust/kernel/drm/gem/mod.rs
> @@ -6,14 +6,29 @@
>
> use crate::{
> alloc::flags::*,
> - bindings, drm,
> - drm::driver::{AllocImpl, AllocOps},
> - error::{to_result, Result},
> + bindings,
> + drm::{
> + self,
> + driver::{
> + AllocImpl,
> + AllocOps, //
> + },
> + },
> + error::{
> + to_result,
> + Result, //
> + },
> prelude::*,
> - sync::aref::{ARef, AlwaysRefCounted},
> + sync::aref::{
> + ARef,
> + AlwaysRefCounted, //
> + },
> types::Opaque,
> };
> -use core::{ops::Deref, ptr::NonNull};
> +use core::{
> + ops::Deref,
> + ptr::NonNull, //
> +};
>
> /// A type alias for retrieving a [`Driver`]s [`DriverFile`] implementation from its
> /// [`DriverObject`] implementation.
>
> base-commit: 6ea52b6d8f33ae627f4dcf43b12b6e713a8b9331
next prev parent reply other threads:[~2026-01-22 23:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 21:43 [PATCH v2 1/2] rust/drm: Fixup import styles Lyude Paul
2026-01-22 21:43 ` [PATCH v2 2/2] rust/drm: Remove imports covered by prelude::* Lyude Paul
2026-02-24 15:17 ` Danilo Krummrich
2026-01-22 23:04 ` Gary Guo [this message]
2026-02-24 15:17 ` [PATCH v2 1/2] rust/drm: Fixup import styles 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=DFVHS3VVR2NL.25TRT6CK2EBB3@garyguo.net \
--to=gary@garyguo.net \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=atharvd440@gmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ewan.chorynski@ik.me \
--cc=lina+kernel@asahilina.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=shankari.ak0208@gmail.com \
--cc=simona@ffwll.ch \
/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