All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Daniel Almeida" <daniel.almeida@collabora.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	"Fiona Behrens" <me@kloenk.dev>
Subject: Re: [PATCH v4] rust: kernel: add support for bits/genmask macros
Date: Thu, 20 Mar 2025 23:02:10 +0900	[thread overview]
Message-ID: <D8L5DDS82E64.37ZBEA441AMJS@nvidia.com> (raw)
In-Reply-To: <BC968EEF-03CD-49A2-818D-08789791E461@collabora.com>

On Thu Mar 20, 2025 at 10:50 PM JST, Daniel Almeida wrote:
> Hi Alex,
>
>> Would it make sense to also have u16 and u8 variants? I guess one can
>> always use genmask_u32 and then cast to the desired type though.
>
> There’s no u16 and u8 variants because I did not think there would be users. 
>
> I can add them otherwise, IMHO we should refrain from using casts when possible.

The plan with the register definition macros is to also support 16-bit
and 8-bit registers, in this case it would be useful to have these as
well.

Since the body of these functions is roughly the same, maybe you can use
a macro to define all the variants?


      reply	other threads:[~2025-03-20 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 15:34 [PATCH v4] rust: kernel: add support for bits/genmask macros Daniel Almeida
2025-03-19 14:25 ` Alexandre Courbot
2025-03-20  4:13   ` Alexandre Courbot
2025-03-20 13:50   ` Daniel Almeida
2025-03-20 14:02     ` Alexandre Courbot [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=D8L5DDS82E64.37ZBEA441AMJS@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@kloenk.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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.