All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eliot Courtney <ecourtney@nvidia.com>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
	"Yury Norov" <yury.norov@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>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Onur Özkan" <work@onurozkan.dev>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>
Cc: John Hubbard <jhubbard@nvidia.com>,
	 Alistair Popple <apopple@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,
	 rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	 nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
	 linux-doc@vger.kernel.org, Eliot Courtney <ecourtney@nvidia.com>
Subject: [PATCH v2 01/12] rust: num: use const_assert! in Bounded
Date: Mon, 10 Aug 2026 22:55:23 +0900	[thread overview]
Message-ID: <20260810-pramin-split-v2-1-65a00b3c7309@nvidia.com> (raw)
In-Reply-To: <20260810-pramin-split-v2-0-65a00b3c7309@nvidia.com>

Convert the const-block asserts in bounded.rs to const_assert!,
matching the rest of the file.

Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
 rust/kernel/num/bounded.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/num/bounded.rs b/rust/kernel/num/bounded.rs
index dafe77782d79..9ad7df1a243d 100644
--- a/rust/kernel/num/bounded.rs
+++ b/rust/kernel/num/bounded.rs
@@ -485,7 +485,7 @@ pub fn cast<U>(self) -> Bounded<U, N>
     /// assert_eq!(v_shifted.get(), 0xff);
     /// ```
     pub fn shr<const SHIFT: u32, const RES: u32>(self) -> Bounded<T, RES> {
-        const { assert!(RES + SHIFT >= N) }
+        const_assert!(RES + SHIFT >= N);
 
         // SAFETY: We shift the value right by `SHIFT`, reducing the number of bits needed to
         // represent the shifted value by as much, and just asserted that `RES >= N - SHIFT`.
@@ -506,7 +506,7 @@ pub fn shr<const SHIFT: u32, const RES: u32>(self) -> Bounded<T, RES> {
     /// assert_eq!(v_shifted.get(), 0xff00);
     /// ```
     pub fn shl<const SHIFT: u32, const RES: u32>(self) -> Bounded<T, RES> {
-        const { assert!(RES >= N + SHIFT) }
+        const_assert!(RES >= N + SHIFT);
 
         // SAFETY: We shift the value left by `SHIFT`, augmenting the number of bits needed to
         // represent the shifted value by as much, and just asserted that `RES >= N + SHIFT`.

-- 
2.55.0


  reply	other threads:[~2026-08-10 13:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 13:55 [PATCH v2 00/12] gpu: nova-core: add PRAMIN window support Eliot Courtney
2026-08-10 13:55 ` Eliot Courtney [this message]
2026-08-10 14:07   ` [PATCH v2 01/12] rust: num: use const_assert! in Bounded sashiko-bot
2026-08-10 14:23   ` Gary Guo
2026-08-10 22:24   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 02/12] rust: num: reject Bounded::shr overshifts at build time Eliot Courtney
2026-08-10 14:23   ` Gary Guo
2026-08-10 22:25   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 03/12] rust: num: add Bounded::shr_exact Eliot Courtney
2026-08-10 22:25   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 04/12] gpu: nova-core: mm: Add VramAddress type Eliot Courtney
2026-08-10 22:24   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 05/12] gpu: nova-core: mm: Implement Alignable and Debug for VramAddress Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 06/12] gpu: nova-core: mm: Add PRAMIN window registers Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 07/12] gpu: nova-core: mm: Add the memory management HAL Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 08/12] gpu: nova-core: mm: Add support to use PRAMIN windows to write to VRAM Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 09/12] docs: gpu: nova-core: Document the PRAMIN aperture mechanism Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 10/12] gpu: nova-core: mm: Add GpuMm centralized memory manager Eliot Courtney
2026-08-10 14:09   ` sashiko-bot
2026-08-10 13:55 ` [PATCH v2 11/12] gpu: nova-core: Add self-test assertion macros and config option Eliot Courtney
2026-08-10 14:09   ` sashiko-bot
2026-08-10 13:55 ` [PATCH v2 12/12] gpu: nova-core: mm: Add PRAMIN aperture self-tests Eliot Courtney
2026-08-10 14:16   ` sashiko-bot
2026-08-10 22:26 ` [PATCH v2 00/12] gpu: nova-core: add PRAMIN window support Danilo Krummrich
2026-08-11 12:31   ` Miguel Ojeda
2026-08-11 12:31 ` Miguel Ojeda

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=20260810-pramin-split-v2-1-65a00b3c7309@nvidia.com \
    --to=ecourtney@nvidia.com \
    --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=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=tzimmermann@suse.de \
    --cc=work@onurozkan.dev \
    --cc=yury.norov@gmail.com \
    /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.