Re: [PATCH v4] rust: kernel: add support for bits/genmask macros
From: Alexandre Courbot
Date: Thu Mar 20 2025 - 10:13:08 EST
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?