From: "Gary Guo" <gary@garyguo.net>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
"Miguel Ojeda" <ojeda@kernel.org>
Cc: <a.hindborg@kernel.org>, <airlied@gmail.com>,
<aliceryhl@google.com>, <bjorn3_gh@protonmail.com>,
<boqun@kernel.org>, <dakr@kernel.org>,
<daniel.almeida@collabora.com>, <gary@garyguo.net>,
<linux-kernel@vger.kernel.org>, <lossin@kernel.org>,
<rust-for-linux@vger.kernel.org>, <simona@ffwll.ch>,
<tamird@kernel.org>, <tmgross@umich.edu>, <work@onurozkan.dev>,
<yury.norov@gmail.com>
Subject: Re: [PATCH] rust: bitfield: add conversions to Bounded of matching width
Date: Wed, 02 Dec 2026 13:39:27 +0000 [thread overview]
Message-ID: <DNAAETZEGJ9W.1YF1X0MD57ITF@garyguo.net> (raw)
In-Reply-To: <DN9TFQTNX1MR.1PSGP4CSESEFF@nvidia.com>
On Wed Dec 2, 2026 at 12:21 AM GMT, Alexandre Courbot wrote:
> On Wed Dec 2, 2026 at 6:18 AM JST, Miguel Ojeda wrote:
>> On Fri, 27 Nov 2026 21:05:40 +0900 Alexandre Courbot <acourbot@nvidia.com> wrote:
>>>
>>> `From`/`Into` implementations already exist between a bitfield type and
>>> its storage type, but these are not enough to support nested bitfields,
>>> since every field is a `Bounded`. This resulted in some ad-hoc
>>> implementations to enable this kind of declaration:
>>>
>>> bitfield! {
>>> pub struct Version(u8) {
>>> 7:4 major;
>>> 3:0 minor;
>>> }
>>> }
>>>
>>> bitfield! {
>>> pub struct Id(u16) {
>>> 15:8 vendor;
>>> 7:0 version => Version;
>>> }
>>> }
>>>
>>> Generate these conversions automatically through the `bitfield!` macro,
>>> as these tend to be useful.
>>>
>>> Tyr had such ad-hoc implementations, so remove them to avoid conflicts.
>>>
>>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>>
>> Applied to `rust-next` -- thanks everyone!
>
> Note that this is going to create a merge conflict with `drm-rust-next`,
> some of the Tyr code has been updated concurrently. It's a single one
> though, and taking "theirs" should solve it, so more trivial than I
> expected.
>
> Which makes me think, there are more patches affecting `num` than I
> initially expected, would it help if I maintained a tree and sent you
> PRs, timed to avoid such conflicts when possible?
Do you expect continued traffic on `num`, or it'd quiet down a bit once the
features are there and users are converted?
Best,
Gary
prev parent reply other threads:[~2026-12-02 13:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 12:05 Alexandre Courbot
2026-11-27 17:15 ` Alice Ryhl
2026-11-27 20:05 ` Gary Guo
2026-11-27 20:36 ` Yury Norov
2026-12-01 21:18 ` Miguel Ojeda
2026-12-02 0:21 ` Alexandre Courbot
2026-12-02 13:31 ` Miguel Ojeda
2026-12-02 13:39 ` Gary Guo [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=DNAAETZEGJ9W.1YF1X0MD57ITF@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®