[Intel-xe] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

Jani Nikula jani.nikula at linux.intel.com
Tue Jun 20 18:19:20 UTC 2023


On Tue, 20 Jun 2023, Andy Shevchenko <andriy.shevchenko at linux.intel.com> wrote:
> So, what does prevent you from using GENMASK_ULL()?
>
> Another point, you may teach GENMASK() to issue a warning if hi and/or lo
> bigger than BITS_PER_LONG.

What good does that do if you want the warning for a fixed size
different from unsigned long or long long? Worse, sizeof(long) depends
on arch, while the GENMASK you want depends on the use case.

> I still don't see the usefulness of that churn.

This thread is turning into a prime example of why drivers and
subsystems reinvent their own wheels instead of trying to get generally
useful stuff merged in kernel headers. :p


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the dri-devel mailing list