[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DEGZ4G00CVTI.VAQH4O4HEXGF@nvidia.com>
Date: Mon, 24 Nov 2025 22:53:34 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Zhi Wang" <zhiw@...dia.com>, "Alice Ryhl" <aliceryhl@...gle.com>
Cc: <rust-for-linux@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <dakr@...nel.org>, <bhelgaas@...gle.com>,
<kwilczynski@...nel.org>, <ojeda@...nel.org>, <alex.gaynor@...il.com>,
<boqun.feng@...il.com>, <gary@...yguo.net>, <bjorn3_gh@...tonmail.com>,
<lossin@...nel.org>, <a.hindborg@...nel.org>, <tmgross@...ch.edu>,
<markus.probst@...teo.de>, <helgaas@...nel.org>, <cjia@...dia.com>,
<smitra@...dia.com>, <ankita@...dia.com>, <aniketa@...dia.com>,
<kwankhede@...dia.com>, <targupta@...dia.com>, <acourbot@...dia.com>,
<joelagnelf@...dia.com>, <jhubbard@...dia.com>, <zhiwang@...nel.org>
Subject: Re: [PATCH v7 3/6] rust: io: factor common I/O helpers into Io
trait
On Mon Nov 24, 2025 at 10:32 PM JST, Zhi Wang wrote:
<snip>
>> But there is another problem: Bounded only supports the case where the
>> bound is a power of two, so I don't think it's usable here. You can
>> have Io regions whose size is not a power of two.
>
> Any suggestion on this? :) Should I implement something like
> BoundedOffset? Also would like to hear some inputs from Danilo as well.
Bounded integers were written with bitfields in mind and that is
reflected in the current implementation, but provided one can devise a
way to check for upper and lower bounds that is simple and works for
both signed and unsigned ints, there should be little standing in the
way of making it more granular and accepting any valid range as the
bounds constraint.
If this proves useful here and we can keep things simple for the
bitfield use-case, then making them more flexible is definitely an
option! :)
Powered by blists - more mailing lists