On 24/03/2025 at 23:28, Yury Norov wrote:
> On Sat, Mar 22, 2025 at 06:23:11PM +0900, Vincent Mailhol via B4 Relay wrote:
>> Introduce some fixed width variant of the GENMASK() and the BIT()
>> macros in bits.h. Note that the main goal is not to get the correct
>> type, but rather to enforce more checks at compile time. For example:
> 
> You say this, and then typecast both BIT and GENMASK. This may confuse
> readers. Maybe add few words about promotion rules in C standard, or
> just drop this note entirely? Doesn't require new submission, of
> course.

I do not want to into this level of details in the cover letter, so I
will remove. Instead, I can add below paragraph to the "bits: introduce
fixed-type GENMASK_U*()" patch:

  The result is casted to the corresponding fixed width type. For
  example, GENMASK_U8() returns an u8. Note that because of the C
  promotion rules, GENMASK_U8() and GENMASK_U16() will immediately be
  promoted to int if used in an expression. Regardless, the main goal is
  not to get the correct type, but rather to enforce more checks at
  compile time.

I staged this change in the v8 together with the other nitpicks from
Andy. If you want that v8, let me know, it is ready. If you are happy
enough with the v7 (and if it doesn't receive more comments), then go
with it!


Yours sincerely,
Vincent Mailhol

Reply via email to