From: "Danilo Krummrich" <dakr@kernel.org>
To: "John Hubbard" <jhubbard@nvidia.com>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Edwin Peer" <epeer@nvidia.com>, "Zhi Wang" <zhiw@nvidia.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpu: nova-core: apply the one "use" item per line policy
Date: Fri, 07 Nov 2025 10:42:48 +0100 [thread overview]
Message-ID: <DE2D56N69NP8.2X1SGEBDM92DG@kernel.org> (raw)
In-Reply-To: <20251107021006.434109-1-jhubbard@nvidia.com>
On Fri Nov 7, 2025 at 3:10 AM CET, John Hubbard wrote:
> As per [1], we need one "use" item per line, in order to reduce merge
> conflicts. Furthermore, we need a trailing ", //" in order to tell
> rustfmt(1) to leave it alone.
>
> This does that for the entire nova-core driver.
>
> [1] https://docs.kernel.org/rust/coding-guidelines.html#imports
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Thanks for doing this!
Few nits below, I assume Alex will fix them up on apply, so no need to resend.
With those fixed,
Acked-by: Danilo Krummrich <dakr@kernel.org>
> diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
> index 27d9edab8347..53e718510568 100644
> --- a/drivers/gpu/nova-core/fb.rs
> +++ b/drivers/gpu/nova-core/fb.rs
> @@ -2,16 +2,24 @@
>
> use core::ops::Range;
>
> -use kernel::prelude::*;
> -use kernel::ptr::{Alignable, Alignment};
> -use kernel::sizes::*;
> -use kernel::sync::aref::ARef;
> -use kernel::{dev_warn, device};
> -
> -use crate::dma::DmaObject;
> -use crate::driver::Bar0;
> -use crate::gpu::Chipset;
> -use crate::regs;
> +use kernel::{
> + dev_warn,
Should be in prelude and hence can be dropped.
> + device,
> + prelude::*,
> + ptr::{
> + Alignable,
> + Alignment, //
> + },
> + sizes::*,
> + sync::aref::ARef, //
> +};
> +
> +use crate::{
> + dma::DmaObject,
> + driver::Bar0,
> + gpu::Chipset,
> + regs, //
> +};
<snip>
> diff --git a/drivers/gpu/nova-core/firmware.rs b/drivers/gpu/nova-core/firmware.rs
> index 4179a74a2342..895309132ae0 100644
> --- a/drivers/gpu/nova-core/firmware.rs
> +++ b/drivers/gpu/nova-core/firmware.rs
> @@ -3,18 +3,24 @@
> //! Contains structures and functions dedicated to the parsing, building and patching of firmwares
> //! to be loaded into a given execution unit.
>
> -use core::marker::PhantomData;
> -use core::mem::size_of;
> -
> -use kernel::device;
> -use kernel::firmware;
> -use kernel::prelude::*;
> -use kernel::str::CString;
> -use kernel::transmute::FromBytes;
> -
> -use crate::dma::DmaObject;
> -use crate::falcon::FalconFirmware;
> -use crate::gpu;
> +use core::{
> + marker::PhantomData,
> + mem::size_of, //
Should be in prelude.
> +};
> +
> +use kernel::{
> + device,
> + firmware,
> + prelude::*,
> + str::CString,
> + transmute::FromBytes, //
> +};
> +
> +use crate::{
> + dma::DmaObject,
> + falcon::FalconFirmware,
> + gpu, //
> +};
>
> pub(crate) mod booter;
> pub(crate) mod fwsec;
> diff --git a/drivers/gpu/nova-core/firmware/booter.rs b/drivers/gpu/nova-core/firmware/booter.rs
> index b4ff1b17e4a0..4d2a6502a879 100644
> --- a/drivers/gpu/nova-core/firmware/booter.rs
> +++ b/drivers/gpu/nova-core/firmware/booter.rs
> @@ -4,20 +4,38 @@
> //! running on [`Sec2`], that is used on Turing/Ampere to load the GSP firmware into the GSP falcon
> //! (and optionally unload it through a separate firmware image).
>
> -use core::marker::PhantomData;
> -use core::mem::size_of;
> -use core::ops::Deref;
> -
> -use kernel::device;
> -use kernel::prelude::*;
> -use kernel::transmute::FromBytes;
> -
> -use crate::dma::DmaObject;
> -use crate::driver::Bar0;
> -use crate::falcon::sec2::Sec2;
> -use crate::falcon::{Falcon, FalconBromParams, FalconFirmware, FalconLoadParams, FalconLoadTarget};
> -use crate::firmware::{BinFirmware, FirmwareDmaObject, FirmwareSignature, Signed, Unsigned};
> -use crate::gpu::Chipset;
> +use core::{
> + marker::PhantomData,
> + mem::size_of,
Same here...
> + ops::Deref, //
> +};
> +
> +use kernel::{
> + device,
> + prelude::*,
> + transmute::FromBytes, //
> +};
> +
> +use crate::{
> + dma::DmaObject,
> + driver::Bar0,
> + falcon::{
> + sec2::Sec2,
> + Falcon,
> + FalconBromParams,
> + FalconFirmware,
> + FalconLoadParams,
> + FalconLoadTarget, //
> + },
> + firmware::{
> + BinFirmware,
> + FirmwareDmaObject,
> + FirmwareSignature,
> + Signed,
> + Unsigned, //
> + },
> + gpu::Chipset, //
> +};
<snip>
> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
> index 9d182bffe8b4..de87efaf09f1 100644
> --- a/drivers/gpu/nova-core/gpu.rs
> +++ b/drivers/gpu/nova-core/gpu.rs
> @@ -1,13 +1,27 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -use kernel::{device, devres::Devres, error::code::*, fmt, pci, prelude::*, sync::Arc};
> -
> -use crate::driver::Bar0;
> -use crate::falcon::{gsp::Gsp as GspFalcon, sec2::Sec2 as Sec2Falcon, Falcon};
> -use crate::fb::SysmemFlush;
> -use crate::gfw;
> -use crate::gsp::Gsp;
> -use crate::regs;
> +use kernel::{
> + device,
> + devres::Devres,
> + error::code::*,
That's also in prelude.
> + fmt,
> + pci,
> + prelude::*,
> + sync::Arc, //
> +};
> +
> +use crate::{
> + driver::Bar0,
> + falcon::{
> + gsp::Gsp as GspFalcon,
> + sec2::Sec2 as Sec2Falcon,
> + Falcon, //
> + },
> + fb::SysmemFlush,
> + gfw,
> + gsp::Gsp,
> + regs, //
> +};
<snip>
> diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
> index aec9166ffb45..b4711126038b 100644
> --- a/drivers/gpu/nova-core/vbios.rs
> +++ b/drivers/gpu/nova-core/vbios.rs
> @@ -2,16 +2,27 @@
>
> //! VBIOS extraction and parsing.
>
> -use crate::driver::Bar0;
> -use crate::firmware::fwsec::Bcrt30Rsa3kSignature;
> -use crate::firmware::FalconUCodeDescV3;
> use core::convert::TryFrom;
> -use kernel::device;
> -use kernel::error::Result;
> -use kernel::prelude::*;
> -use kernel::ptr::{Alignable, Alignment};
> -use kernel::transmute::FromBytes;
> -use kernel::types::ARef;
> +
> +use kernel::{
> + device,
> + error::Result,
prelude
> + prelude::*,
> + ptr::{
> + Alignable,
> + Alignment, //
> + },
> + transmute::FromBytes,
> + types::ARef, //
> +};
> +
> +use crate::{
> + driver::Bar0,
> + firmware::{
> + fwsec::Bcrt30Rsa3kSignature,
> + FalconUCodeDescV3, //
> + }, //
> +};
next prev parent reply other threads:[~2025-11-07 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 2:10 [PATCH] gpu: nova-core: apply the one "use" item per line policy John Hubbard
2025-11-07 3:49 ` Alexandre Courbot
2025-11-07 9:42 ` Danilo Krummrich [this message]
2025-11-07 14:17 ` Alexandre Courbot
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=DE2D56N69NP8.2X1SGEBDM92DG@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=bhelgaas@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=epeer@nvidia.com \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=zhiw@nvidia.com \
/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