[PATCH 1/2] linux/bitfield.h: import FIELD_PREP_CONST macro from Linux Kernel
Quentin Schulz
quentin.schulz at cherry.de
Wed Jun 4 10:55:57 CEST 2025
Hi Christian,
On 6/3/25 10:37 PM, Christian Marangi wrote:
> On Tue, Jun 03, 2025 at 05:08:13PM +0200, Quentin Schulz wrote:
>> Hi Christian,
>>
>> On 6/3/25 10:51 AM, Christian Marangi wrote:
>>> Import FIELD_PREP_CONST macro from Linux Kernel to permit usage of
>>> FIELD_PREP with scenario where a constant value is needed.
>>>
>>> Refer to commit e2192de59e45 ("bitfield: add FIELD_PREP_CONST()") in
>>> Linux kernel for extensive explaination of why this is useful.
>>>
>>> This is also to better align with the Linux Kernel for easier porting of
>>> driver.
>>>
>>
>> Do you know it it'd be possible to simply copy Linux kernel's bitfield.h
>> instead of "cherry-picking" individual commit(s)?
>>
>
> Mhhh what do you mean? You mean syncing the full header with latest
> version?
>
> Isn't that more risky??
>
Not necessarily, it means it's easier for us to simply sync with newer
Linux kernel versions or make sure that we're actually importing the
same macros/constants/etc. And also the review is extremely simple.
Checkout master U-Boot, checkout the Linux kernel at whatever version
you're saying you're copying the file from, copy it, check the diff,
matches patch? Reviewed-by given since it already went through proper
review in the kernel :)
Also would make it easier to port drivers from the kernel to U-Boot as
the kernel community encourages more and more uses of macros from that
header but if we only do cherry-picks (or even partial cherry-picks)
then things get unnecessarily harder.
The kernel typically gets more eyes on and fixes than U-Boot (or such is
my gut feeling), so being able to easily know if we need to backport
something to U-Boot by simply reading the kernel mailing list/scouring
the git history of the kernel is pretty useful.
Cheers,
Quentin
More information about the U-Boot
mailing list