diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 785d7d1099d4..1221d2331a6d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -735,6 +735,10 @@ struct sysinfo { | |||
735 | /* Force a compilation error if condition is constant and true */ | 735 | /* Force a compilation error if condition is constant and true */ |
736 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | 736 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) |
737 | 737 | ||
738 | /* Force a compilation error if a constant expression is not a power of 2 */ | ||
739 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | ||
740 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | ||
741 | |||
738 | /* Force a compilation error if condition is true, but also produce a | 742 | /* Force a compilation error if condition is true, but also produce a |
739 | result (of value 0 and type size_t), so the expression can be used | 743 | result (of value 0 and type size_t), so the expression can be used |
740 | e.g. in a structure initializer (or where-ever else comma expressions | 744 | e.g. in a structure initializer (or where-ever else comma expressions |