diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 01:19:54 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 13:22:22 +0100 |
commit | 02891861e92165bbfcc23fc5ee0a52478d89de41 (patch) | |
tree | 8c229bfdc4d10c7b0dba1cad6f5e22ca98cf8e95 | |
parent | a123be2cb92f7b20ecaa5d8929f177c701d94aef (diff) |
linux/power_of_2.h: Implement [__]BUILD_BUG_ON_NOT_POWER_OF_2() in terms of __IS_POWER_OF_2[_OR_0]()memberof
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | include/linux/power_of_2.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/power_of_2.h b/include/linux/power_of_2.h index 132592f0b718..80d11714b0ad 100644 --- a/include/linux/power_of_2.h +++ b/include/linux/power_of_2.h @@ -10,10 +10,8 @@ #define __IS_POWER_OF_2(n) (__IS_POWER_OF_2_OR_0(n) && ((n) != 0)) /* Force a compilation error if a constant expression is not a power of 2 */ -#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \ - BUILD_BUG_ON(((n) & ((n) - 1)) != 0) -#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ - BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) +#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) BUILD_BUG_ON(!__IS_POWER_OF_2_OR_0(n)) +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) BUILD_BUG_ON(!__IS_POWER_OF_2(n)) #endif /* _LINUX_POWER_OF_2_H */ |