[PATCH v3 1/6] bitfield: Add FIELD_MODIFY() helper

Jie Luo quic_luoj at quicinc.com
Wed Apr 23 06:05:47 PDT 2025



On 4/19/2025 1:11 AM, Yury Norov wrote:
>> Add a helper for replacing the contents of bitfield in memory
>> with the specified value.
>>
>> Even though a helper xxx_replace_bits() is available, it is not
>> well documented, and only reports errors at the run time, which
>> will not be helpful to catch possible overflow errors due to
>> incorrect parameter types used.
>>
>> Add the helper FIELD_MODIFY() to the FIELD_XXX family of bitfield
>> macros. It is functionally similar as xxx_replace_bits(), and in
>> addition adds the compile time type checking.
> This paragraph duplicates the above. I'll drop it and take this
> patch to bitmap-for-next. Regarding the rest of the series - it's up
> to ARM64 and Cocci maintainers if they want them or not.
> 
> Thanks for the work!
> 
> Thanks,
> Yury

OK, thanks.



More information about the linux-arm-kernel mailing list