From: sashiko-bot@kernel.org
To: "Eliot Courtney" <ecourtney@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
ojeda@kernel.org, dri-devel@lists.freedesktop.org,
"Alexandre Courbot" <acourbot@nvidia.com>
Subject: Re: [PATCH v7 06/10] rust: id_pool: take a NonZero capacity in with_capacity
Date: Mon, 17 Aug 2026 07:12:08 +0000 [thread overview]
Message-ID: <20260817071208.8FB8E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817-chid-v7-6-a5872e64d8f4@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The modified imports in the doc test do not fully adhere to the kernel vertical import style.
--
--- Patch [6]: [PATCH v7 06/10] rust: id_pool: take a NonZero capacity in with_capacity ---
commit f4b7961ebb7650ae12d08eb8b7b640d56c620f68
Author: Eliot Courtney <ecourtney@nvidia.com>
rust: id_pool: take a NonZero capacity in with_capacity
This commit modifies IdPool::with_capacity to accept a NonZero capacity
type instead of a standard integer. It updates the implementation to extract
the non-zero value and adjusts the corresponding documentation tests to use
the nz macro.
> diff --git a/rust/kernel/id_pool.rs b/rust/kernel/id_pool.rs
> index 384753fe0e44a..9494fde701eea 100644
> --- a/rust/kernel/id_pool.rs
> +++ b/rust/kernel/id_pool.rs
> @@ -23,10 +23,13 @@
> /// Basic usage
> ///
> /// ```
> -/// use kernel::alloc::AllocError;
> -/// use kernel::id_pool::{IdPool, UnusedId};
> +/// use kernel::{
> +/// alloc::AllocError,
> +/// id_pool::{IdPool, UnusedId},
[Severity: Low]
This isn't a bug, but the modified imports in this doc test do not fully adhere
to the kernel vertical import style.
Should IdPool and UnusedId be split onto their own lines?
> +/// nz, //
> +/// };
> ///
> -/// let mut pool = IdPool::with_capacity(64, GFP_KERNEL)?;
> +/// let mut pool = IdPool::with_capacity(nz!(64), GFP_KERNEL)?;
> /// for i in 0..64 {
> /// assert_eq!(i, pool.find_unused_id(i).ok_or(ENOSPC)?.acquire());
> /// }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-chid-v7-0-a5872e64d8f4@nvidia.com?part=6
next prev parent reply other threads:[~2026-08-17 7:12 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 7:04 [PATCH v7 00/10] rust: Add support for reserving of ranges of IDs Eliot Courtney
2026-08-17 7:04 ` [PATCH v7 01/10] rust: bitmap: use function-level cfg on kunit test Eliot Courtney
2026-08-17 10:29 ` Gary Guo
2026-08-17 19:42 ` Burak Emir
2026-08-17 7:04 ` [PATCH v7 02/10] rust: bitmap: restrict bitmap length to at most i32::MAX Eliot Courtney
2026-08-17 19:51 ` Burak Emir
2026-08-21 7:37 ` Alexandre Courbot
2026-08-24 12:04 ` Eliot Courtney
2026-08-17 7:04 ` [PATCH v7 03/10] rust: num: add nz! macro for compile time NonZero values Eliot Courtney
2026-08-19 20:07 ` Gary Guo
2026-08-25 11:10 ` Eliot Courtney
2026-08-21 7:39 ` Alexandre Courbot
2026-08-17 7:04 ` [PATCH v7 04/10] rust: sizes: implement SizeConstants for Alignment Eliot Courtney
2026-08-17 7:12 ` sashiko-bot
2026-08-21 7:46 ` Alexandre Courbot
2026-08-25 6:59 ` Eliot Courtney
2026-08-17 7:04 ` [PATCH v7 05/10] rust: bitmap: add contiguous area operations Eliot Courtney
2026-08-17 20:12 ` Burak Emir
2026-08-21 8:11 ` Alexandre Courbot
2026-08-21 8:31 ` Miguel Ojeda
2026-08-21 11:04 ` Alexandre Courbot
2026-08-21 19:35 ` Miguel Ojeda
2026-08-25 8:33 ` Eliot Courtney
2026-08-17 7:04 ` [PATCH v7 06/10] rust: id_pool: take a NonZero capacity in with_capacity Eliot Courtney
2026-08-17 7:12 ` sashiko-bot [this message]
2026-08-17 20:13 ` Burak Emir
2026-08-21 8:39 ` Alexandre Courbot
2026-08-25 11:09 ` Eliot Courtney
2026-08-25 13:12 ` Alice Ryhl
2026-08-25 12:10 ` Alice Ryhl
2026-08-17 7:04 ` [PATCH v7 07/10] rust: id_pool: add contiguous ID reservation Eliot Courtney
2026-08-17 7:14 ` sashiko-bot
2026-08-17 20:21 ` Burak Emir
2026-08-21 8:30 ` Alexandre Courbot
2026-08-17 7:04 ` [PATCH v7 08/10] rust: id_pool: do not round capacity up to BitmapVec::MAX_INLINE_LEN Eliot Courtney
2026-08-17 20:39 ` Burak Emir
2026-08-17 7:04 ` [PATCH v7 09/10] gpu: nova-core: add ChannelIdPool Eliot Courtney
2026-08-17 7:04 ` [PATCH v7 10/10] rust: use Alignment size constants Eliot Courtney
2026-08-21 11:04 ` 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=20260817071208.8FB8E1F000E9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox