From: sashiko-bot@kernel.org
To: "Eliot Courtney" <ecourtney@nvidia.com>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
ojeda@kernel.org, "Danilo Krummrich" <dakr@kernel.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 03/12] rust: num: add Bounded::shr_exact
Date: Wed, 05 Aug 2026 05:51:14 +0000 [thread overview]
Message-ID: <20260805055115.12BE31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260805-pramin-split-v1-3-ff3e84a75dac@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The small abstraction function `shr_exact` is missing the `#[inline]` attribute.
--
--- Patch [3]: [PATCH 03/12] rust: num: add Bounded::shr_exact ---
commit fe8d74a80e41351c792119ee859ab7990c063f88
Author: Eliot Courtney <ecourtney@nvidia.com>
rust: num: add Bounded::shr_exact
This commit adds shr_exact to shift a bounded value right only if it loses
no set bits. This is useful for getting a shifted down integer while
simultaneously checking that it is aligned.
> diff --git a/rust/kernel/num/bounded.rs b/rust/kernel/num/bounded.rs
> index f263107f001ed..2695a7858d8ad 100644
> --- a/rust/kernel/num/bounded.rs
> +++ b/rust/kernel/num/bounded.rs
[ ... ]
> + /// // A set bit would be shifted out.
> + /// let v = Bounded::<u32, 16>::new::<0xff01>();
> + /// let v_shifted: Option<Bounded<u32, 8>> = v.shr_exact::<8, _>();
> + ///
> + /// assert!(v_shifted.is_none());
> + /// ```
> + pub fn shr_exact<const SHIFT: u32, const RES: u32>(self) -> Option<Bounded<T, RES>> {
[Severity: Low]
This isn't a bug, but should this small abstraction function be annotated
with #[inline]? According to the Rust subsystem coding guidelines, functions
that are small or forwarding to a binding call should be annotated with
#[inline].
> + let shifted = self.shr::<SHIFT, RES>();
> + if shifted.get() << SHIFT == self.0 {
> + Some(shifted)
> + } else {
> + None
> + }
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805-pramin-split-v1-0-ff3e84a75dac@nvidia.com?part=3
next prev parent reply other threads:[~2026-08-05 5:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 5:44 [PATCH 00/12] gpu: nova-core: add PRAMIN window support Eliot Courtney
2026-08-05 5:44 ` [PATCH 01/12] rust: io: add Region::try_subregion Eliot Courtney
2026-08-05 10:43 ` Gary Guo
2026-08-07 5:39 ` Eliot Courtney
2026-08-07 14:03 ` Alexandre Courbot
2026-08-07 14:09 ` Gary Guo
2026-08-10 6:32 ` Eliot Courtney
2026-08-05 5:44 ` [PATCH 02/12] rust: num: reject Bounded::shr overshifts at build time Eliot Courtney
2026-08-05 5:55 ` sashiko-bot
2026-08-07 14:03 ` Alexandre Courbot
2026-08-07 17:12 ` Miguel Ojeda
2026-08-09 2:12 ` Alexandre Courbot
2026-08-07 19:14 ` Gary Guo
2026-08-05 5:44 ` [PATCH 03/12] rust: num: add Bounded::shr_exact Eliot Courtney
2026-08-05 5:51 ` sashiko-bot [this message]
2026-08-07 14:04 ` Alexandre Courbot
2026-08-05 5:44 ` [PATCH 04/12] gpu: nova-core: mm: Add VramAddress type Eliot Courtney
2026-08-05 5:49 ` sashiko-bot
2026-08-05 5:44 ` [PATCH 05/12] gpu: nova-core: mm: Implement Alignable and Debug for VramAddress Eliot Courtney
2026-08-05 5:44 ` [PATCH 06/12] gpu: nova-core: mm: Add PRAMIN window registers Eliot Courtney
2026-08-05 5:44 ` [PATCH 07/12] gpu: nova-core: mm: Add the memory management HAL Eliot Courtney
2026-08-05 5:44 ` [PATCH 08/12] gpu: nova-core: mm: Add support to use PRAMIN windows to write to VRAM Eliot Courtney
2026-08-05 5:44 ` [PATCH 09/12] docs: gpu: nova-core: Document the PRAMIN aperture mechanism Eliot Courtney
2026-08-05 5:44 ` [PATCH 10/12] gpu: nova-core: mm: Add GpuMm centralized memory manager Eliot Courtney
2026-08-05 5:52 ` sashiko-bot
2026-08-05 5:44 ` [PATCH 11/12] gpu: nova-core: Add self-test assertion macros and config option Eliot Courtney
2026-08-05 5:44 ` [PATCH 12/12] gpu: nova-core: mm: Add PRAMIN aperture self-tests 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=20260805055115.12BE31F000E9@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.