From: "Danilo Krummrich" <dakr@kernel.org>
To: "Eliot Courtney" <ecourtney@nvidia.com>
Cc: <ljs@kernel.org>, <vbabka@kernel.org>, <Liam.Howlett@oracle.com>,
<urezki@gmail.com>, <ojeda@kernel.org>, <boqun@kernel.org>,
<gary@garyguo.net>, <bjorn3_gh@protonmail.com>,
<lossin@kernel.org>, <a.hindborg@kernel.org>,
<aliceryhl@google.com>, <tmgross@umich.edu>,
<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] rust: alloc: cleanup imports and use "kernel vertical" style
Date: Tue, 12 May 2026 16:28:37 +0200 [thread overview]
Message-ID: <DIGRPCOV5K8K.9S45JQA92MMN@kernel.org> (raw)
In-Reply-To: <DIGQSPXOI9ST.3R3JHV2N5UNML@nvidia.com>
On Tue May 12, 2026 at 3:46 PM CEST, Eliot Courtney wrote:
> On Tue May 12, 2026 at 6:41 AM JST, Danilo Krummrich wrote:
>> Change all imports in the alloc module to use the "kernel vertical"
>> import style [1].
>>
>> While at it, drop unnecessary imports covered by prelude::*.
>>
>> Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1]
>> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
>> ---
>
> There are some non-vertical style imports in rust/kernel/alloc.rs,
> should those be changed too?
Yes, thanks for catching this, and the one below.
>> --- a/rust/kernel/alloc/kbox.rs
>> +++ b/rust/kernel/alloc/kbox.rs
>> @@ -3,24 +3,46 @@
>> //! Implementation of [`Box`].
>>
>> #[allow(unused_imports)] // Used in doc comments.
>> -use super::allocator::{KVmalloc, Kmalloc, Vmalloc, VmallocPageIter};
>> -use super::{AllocError, Allocator, Flags, NumaNode};
>> -use core::alloc::Layout;
>> -use core::borrow::{Borrow, BorrowMut};
>> -use core::marker::PhantomData;
>> -use core::mem::ManuallyDrop;
>> -use core::mem::MaybeUninit;
>> -use core::ops::{Deref, DerefMut};
>> -use core::pin::Pin;
>> -use core::ptr::NonNull;
>> -use core::result::Result;
>> -
>> -use crate::ffi::c_void;
>> -use crate::fmt;
>> -use crate::init::InPlaceInit;
>> -use crate::page::AsPageIter;
>> -use crate::types::ForeignOwnable;
>> -use pin_init::{InPlaceWrite, Init, PinInit, ZeroableOption};
>> +use super::{
>> + allocator::{
>> + KVmalloc,
>> + Kmalloc,
>> + Vmalloc,
>> + VmallocPageIter, //
>> + },
>> + AllocError,
>> + Allocator,
>> + Flags,
>> + NumaNode, //
>> +};
>
> This changes the scope of `allow(unused_imports)`. Is this intentional?
>
> Both nits so:
>
> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
prev parent reply other threads:[~2026-05-12 14:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 21:41 [PATCH 1/2] rust: alloc: cleanup imports and use "kernel vertical" style Danilo Krummrich
2026-05-11 21:41 ` [PATCH 2/2] rust: alloc: cleanup doctest imports to " Danilo Krummrich
2026-05-12 13:46 ` Eliot Courtney
2026-05-12 14:11 ` Gary Guo
2026-05-12 14:29 ` Danilo Krummrich
2026-05-12 13:46 ` [PATCH 1/2] rust: alloc: cleanup imports and use " Eliot Courtney
2026-05-12 14:28 ` Danilo Krummrich [this message]
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=DIGRPCOV5K8K.9S45JQA92MMN@kernel.org \
--to=dakr@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
/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