From: sashiko-bot@kernel.org
To: "Eliot Courtney" <ecourtney@nvidia.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
"Uladzislau Rezki" <urezki@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "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>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: "John Hubbard" <jhubbard@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>,
nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 2/7] rust: alloc: add ArrayVec
Date: Fri, 16 Oct 2026 02:04:09 +0000 [thread overview]
Message-ID: <sashiko-outbox-173611@kernel.org> (raw)
In-Reply-To: <20261016-b4-nvkv-v4-2-e8b92b91aa5b@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rust: missing #[inline] on try_push_init and extend_from_slice
--
commit 83efda44f14b36e4aab4040f689c08677c6c23f1
Author: Eliot Courtney <ecourtney@nvidia.com>
rust: alloc: add ArrayVec
Add a fixed capacity vector backed by [MaybeUninit<T>; N]. The ArrayVec
is also initializable with a closure, returning an Init instance, to
avoid constructing it on the stack.
> diff --git a/rust/kernel/alloc/arrayvec.rs b/rust/kernel/alloc/arrayvec.rs
> new file mode 100644
> index 0000000000000..8793adf4d27b7
> --- /dev/null
> +++ b/rust/kernel/alloc/arrayvec.rs
[ ... ]
> + /// Appends an element to the back of the [`ArrayVec`] by initializing it in place.
> + ///
> + /// Unlike [`ArrayVec::push_init`], the initializer may be fallible. If the [`ArrayVec`] is
> + /// full, the original initializer `init` is handed back in [`TryPushInitError::Full`]. If the
> + /// initializer itself fails, its error is returned in [`TryPushInitError::InitError`].
> + pub fn try_push_init<I, E>(&mut self, init: I) -> Result<(), TryPushInitError<I, E>>
> + where
> + I: Init<T, E>,
> + {
> + let Some(slot) = self.spare_capacity_mut().first_mut() else {
[Severity: Low]
This isn't a bug, but is try_push_init() missing an #[inline] attribute?
The Rust subsystem coding guidelines state that small functions in abstractions
should be annotated with #[inline].
[ ... ]
> + /// Appends a clone of each element in `slice` to the back of the [`ArrayVec`].
> + ///
> + /// Fails with [`EINVAL`] if `slice` is longer than the remaining capacity.
> + pub fn extend_from_slice(&mut self, slice: &[T]) -> Result
> + where
> + T: Clone,
> + {
> + let Some(dst) = self.spare_capacity_mut().get_mut(..slice.len()) else {
[Severity: Low]
This isn't a bug, but is extend_from_slice() also missing an #[inline]
attribute? The Rust subsystem coding guidelines state that small functions in
abstractions should be annotated with #[inline].
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-b4-nvkv-v4-0-e8b92b91aa5b@nvidia.com?part=2
next prev parent reply other threads:[~2026-10-16 2:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 1:53 [PATCH v4 0/7] gpu: nova-core: add NVKV codec Eliot Courtney
2026-10-16 1:53 ` [PATCH v4 1/7] rust: alloc: add Vec::try_push_init and Vec::push_init Eliot Courtney
2026-10-16 1:53 ` [PATCH v4 2/7] rust: alloc: add ArrayVec Eliot Courtney
2026-10-16 2:04 ` sashiko-bot [this message]
2026-10-16 1:53 ` [PATCH v4 3/7] gpu: nova-core: add NVKV encoder Eliot Courtney
2026-10-16 1:53 ` [PATCH v4 4/7] gpu: nova-core: add NVKV decoder Eliot Courtney
2026-10-16 2:00 ` sashiko-bot
2026-10-16 2:05 ` John Hubbard
2026-10-16 1:53 ` [PATCH v4 5/7] gpu: nova-core: add NVKV typed encoding Eliot Courtney
2026-10-16 1:53 ` [PATCH v4 6/7] gpu: nova-core: add NVKV typed decoding Eliot Courtney
2026-10-16 1:53 ` [PATCH v4 7/7] gpu: nova-core: add NVKV GSP_INIT schemas Eliot Courtney
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=sashiko-outbox-173611@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=liam@infradead.org \
--cc=ljs@kernel.org \
--cc=lossin@kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
--cc=work@onurozkan.dev \
/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