[PATCH 1/2] bitops: Guard GENMASK and GENMASK_ULL against prior defines
Quentin Schulz
quentin.schulz at cherry.de
Thu May 7 18:31:51 CEST 2026
Hi Simon,
Thanks for doing that! Did you run this in our GitLab CI by any chance?
I'm a bit wary of the sandbox implementation since it isn't actually
interacting with an EC, but at least *some* test being run in CI would
be nice :)
On 4/30/26 1:38 PM, Simon Glass wrote:
> Some headers - notably the ec_commands.h synced from upstream
> Chrome OS EC - define GENMASK and GENMASK_ULL themselves before
> linux/bitops.h is pulled in. The unguarded definitions here then trigger
> a 'redefined' warning at the second site, even though both spellings
> produce the same mask.
>
> Wrap the two macros in '#ifndef' guards so a pre-existing definition
> wins. The U-Boot expressions are unchanged.
>
Considering how often we may sync cros_ec compared to
include/linux/bitops.h, I'm tempted to patch cros_ec instead and leave
include/linux/bitops.h alone.
I'll comment in the next patch what I think may be enough.
Cheers,
Quentin
More information about the U-Boot
mailing list