[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D553B512-2338-4602-8EEE-B87B2BFC2FC8@collabora.com>
Date: Fri, 20 Jun 2025 10:48:56 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Joel Fernandes <joelagnelf@...dia.com>
Cc: Boqun Feng <boqun.feng@...il.com>,
Alexandre Courbot <acourbot@...dia.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v6] rust: kernel: add support for bits/genmask macros
Hi Joel,
>
>>>>>
>>>>
>>>> I think generic over `RangeBounds` is a good idea, and we should
>>>> .is_emtpy() or .contains() instead of comparison + boolean operation
>>>> when possible. Seems we need a function to check whether one range
>
> I am also of the opinion that RangeBounds is a good idea. I think it may come
> down to both classes of devs, those who have used genmask before in C and
> expect inclusivity, and those who are using it for the first time in Rust -
> the latter may almost always want to use the non-inclusive syntax, no?
>
> thanks,
>
> - Joel
Can’t do that in a const fn, and we really want a const fn as the default.
Hence my suggestion to only support a..=b, which is both correct and explicit.
— Daniel
Powered by blists - more mailing lists