Re: [PATCH v2 4/4] drm/i915: introduce _FIELD() to define register field values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Jani Nikula (2019-01-17 12:14:03)
>  #define _MASK(__high, __low)   ((u32)GENMASK(__high, __low))
>  
> +#define __POWER_OF_2(x)        ((x) && (((x) & ((x) - 1)) == 0))

Fwiw, I'd go with IS_POWER_OF_2(x) /* compile-time constant version of is_power_of_2() */

For constexpr!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux