Re: [PATCH 00/21] lib: add alternatives for GENMASK()
From: Alexey Dobriyan
Date: Sat Oct 25 2025 - 14:00:59 EST
> GENMASK(high, low) notation reflects a common pattern to describe
> hardware registers. However, out of drivers context it's confusing and
> error-prone.
>
> This series introduces alternatives for GENMASK():
>
> - BITS(low, high);
This is less bad (low bit then high), but in a perfect world high bit
should have been exclusive.
> - FIRST_BITS(nbits);
> - LAST_BITS(start);
Now it is 200% more confusing.