rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Yury Norov" <yury.norov@gmail.com>,
	"Jesung Yang" <y.j3ms.n@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v4 0/4] rust: add Bounded integer type
Date: Wed, 19 Nov 2025 01:06:28 +0100	[thread overview]
Message-ID: <CANiq72nV1zwoCCcHuizdfqWF=e8hvd6RO1CBXTEt73eqe4ayaA@mail.gmail.com> (raw)
In-Reply-To: <20251108-bounded_ints-v4-0-c9342ac7ebd1@nvidia.com>

On Sat, Nov 8, 2025 at 3:24 AM Alexandre Courbot <acourbot@nvidia.com> wrote:
>
> Minor revision adding the feedback received on v3.
>
> Patch 3 adds a MAINTAINERS entry in case the Rust core team would like
> us to maintain this, but please ignore it if you prefer to take it under
> the core umbrella.
>
> This series provides `Bounded`, a wrapper type for primitive integers
> that guarantees that only a given number of bits are used to represent
> values. This is particularly useful when working with bitfields, as the
> guarantee that a given value fits within the number of assigned bits can
> be enforced by the type system, saving cumbersome runtime checks, or
> (worse) stripping data when bits are silently dropped.
>
> For a basic usage, please see the rustdoc of the `Bounded` type on the
> second patch.
>
> The first use of this will be to represent bitfields in Nova register
> types to guarantee that no data is ever stripped when manipulating them.
> This should eventually allow the `bitfield` and `register` macros to
> move out of Nova and into the kernel crate.
>
> The last patch is just here to illustrate the use of this module; it is
> not intended to be merged this cycle as it would likely result in big
> merge conflicts with the drm tree.
>
> This series applies on top of drm-rust-next for the needs of the last
> patch, but the first 2 patches should apply cleanly on rust-next. A
> branch with this series and its dependencies is available here:
>
> https://github.com/Gnurou/linux/tree/b4/bounded_ints
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

Applied to `rust-next` -- thanks everyone!

    [ Added intra-doc link. Fixed a few other nits. - Miguel ]

Cheers,
Miguel

      parent reply	other threads:[~2025-11-19  0:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-08  2:23 [PATCH v4 0/4] rust: add Bounded integer type Alexandre Courbot
2025-11-08  2:23 ` [PATCH v4 1/4] rust: add num module and Integer trait Alexandre Courbot
2025-11-08  2:23 ` [PATCH v4 2/4] rust: num: add Bounded integer wrapping type Alexandre Courbot
2025-11-08  2:23 ` [PATCH v4 3/4] MAINTAINERS: add entry for the Rust `num` module Alexandre Courbot
2025-11-17  7:11   ` Miguel Ojeda
2025-11-17 15:12     ` Yury Norov
2025-11-08  2:23 ` [PATCH FOR REFERENCE v4 4/4] gpu: nova-core: use BitInt for bitfields Alexandre Courbot
2025-11-11  8:12 ` [PATCH v4 0/4] rust: add Bounded integer type Alexandre Courbot
2025-11-11 20:46   ` Miguel Ojeda
2025-11-12  0:55     ` Alexandre Courbot
2025-11-12  1:10       ` Miguel Ojeda
2025-11-11 10:49 ` Alice Ryhl
2025-11-19  0:06 ` Miguel Ojeda [this message]

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='CANiq72nV1zwoCCcHuizdfqWF=e8hvd6RO1CBXTEt73eqe4ayaA@mail.gmail.com' \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=y.j3ms.n@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).