[PATCH 1/2] linux/bitfield.h: import FIELD_PREP_CONST macro from Linux Kernel

Tom Rini trini at konsulko.com
Wed Jun 4 01:50:23 CEST 2025


On Tue, Jun 03, 2025 at 10:37:22PM +0200, 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??

It would be helpful and shouldn't be too risky. At a quick glance, the
first minor issue is to just keep using <linux/bug.h> as
include/linux/bug*h also need to be resynced. This kind of change would
need to be run through CI as well as documented at
https://docs.u-boot.org/en/latest/develop/ci_testing.html

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250603/3dcd8127/attachment.sig>


More information about the U-Boot mailing list