diff options
| author | David S. Miller <davem@davemloft.net> | 2010-02-17 16:20:14 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:20:14 -0800 |
| commit | 8c2fcadc933f713d51f46ec4dcd9b12830e0df84 (patch) | |
| tree | e0797b2db664d702f9d02dd0f45efddb2f0d7fe9 /include/linux/kernel.h | |
| parent | 232486e1e9f34889424b68ee6270440b554479a2 (diff) | |
| parent | b0483e78e5c4c9871fc5541875b3bc006846d46b (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
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 3fc9f5aab5f8..328bca609b9b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -734,6 +734,10 @@ struct sysinfo { /* Force a compilation error if condition is constant and true */ #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) +/* 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) == 0 || (((n) & ((n) - 1)) != 0)) + /* Force a compilation error if condition is true, but also produce a result (of value 0 and type size_t), so the expression can be used e.g. in a structure initializer (or where-ever else comma expressions |
