From: sashiko-bot@kernel.org
To: "Eliot Courtney" <ecourtney@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
dri-devel@lists.freedesktop.org, ojeda@kernel.org
Subject: Re: [PATCH v6 5/7] rust: id_pool: take a NonZero capacity in with_capacity
Date: Thu, 13 Aug 2026 07:40:07 +0000 [thread overview]
Message-ID: <20260813074007.AEEA91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813-chid-v6-5-160be5dfb5bd@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The new imports in the documentation tests violate the kernel vertical import style.
--
--- Patch [5]: [PATCH v6 5/7] rust: id_pool: take a NonZero capacity in with_capacity ---
commit e9e2e8ccc28f355c2c0d256d428875b948d75705
Author: Eliot Courtney <ecourtney@nvidia.com>
rust: id_pool: take a NonZero capacity in with_capacity
This commit updates IdPool::with_capacity to take a NonZero capacity,
as an IdPool should not be allocated with zero capacity.
> diff --git a/rust/kernel/id_pool.rs b/rust/kernel/id_pool.rs
> --- a/rust/kernel/id_pool.rs
> +++ b/rust/kernel/id_pool.rs
> @@ -29,10 +29,11 @@
> /// Basic usage
> ///
> /// ```
> +/// use core::num::NonZero;
> /// use kernel::alloc::AllocError;
[Severity: Low]
This isn't a bug, but should there be a blank line between the core:: and
kernel:: imports to follow the kernel vertical import style?
> /// use kernel::id_pool::{IdPool, UnusedId};
> ///
> -/// let mut pool = IdPool::with_capacity(64, GFP_KERNEL)?;
> +/// let mut pool = IdPool::with_capacity(NonZero::new(64).unwrap(), GFP_KERNEL)?;
[ ... ]
> @@ -138,6 +139,7 @@ pub fn capacity(&self) -> usize {
> /// # Examples
> ///
> /// ```
> +/// use core::num::NonZero;
> /// use kernel::{
[Severity: Low]
This isn't a bug, but could we add a blank line here as well to separate the
core imports from the kernel imports?
> /// alloc::AllocError,
> /// bitmap::BitmapVec,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813-chid-v6-0-160be5dfb5bd@nvidia.com?part=5
next prev parent reply other threads:[~2026-08-13 7:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 7:34 [PATCH v6 0/7] rust: Add support for reserving of ranges of IDs Eliot Courtney
2026-08-13 7:34 ` [PATCH v6 1/7] rust: bitmap: use function-level cfg on kunit test Eliot Courtney
2026-08-13 7:34 ` [PATCH v6 2/7] rust: bitmap: restrict bitmap length to at most i32::MAX Eliot Courtney
2026-08-13 7:34 ` [PATCH v6 3/7] rust: bitmap: add contiguous area operations Eliot Courtney
2026-08-13 7:34 ` [PATCH v6 4/7] rust: id_pool: add contiguous area allocation Eliot Courtney
2026-08-13 7:44 ` sashiko-bot
2026-08-13 7:34 ` [PATCH v6 5/7] rust: id_pool: take a NonZero capacity in with_capacity Eliot Courtney
2026-08-13 7:40 ` sashiko-bot [this message]
2026-08-13 7:34 ` [PATCH v6 6/7] rust: id_pool: do not round capacity up to BitmapVec::MAX_INLINE_LEN Eliot Courtney
2026-08-13 7:34 ` [PATCH v6 7/7] gpu: nova-core: add ChannelIdPool 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=20260813074007.AEEA91F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=acourbot@nvidia.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.