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