From 31036ddcf8432cfdaf997172bf2050543b21dd61 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Fri, 15 Jan 2010 17:01:22 -0800 Subject: [PATCH] --- yaml --- r: 179351 b: refs/heads/master c: cc8ef6eb21e964b1c5eb97b2d0e8ac9893e1bf86 h: refs/heads/master i: 179349: 5583ad7f5e43cbc01508125caaf0afec0300fd0c 179347: a4f3e9b95420a14c0d16f9f71910d4307ba035af 179343: 88b1043815f06d70ab6ebb83dcda68cb4caafc19 v: v3 --- [refs] | 2 +- trunk/include/linux/kernel.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 60b55d17e851..da4e05fe63ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d2dbe08ddceb4ba2b274abb84326d7e69d454e5c +refs/heads/master: cc8ef6eb21e964b1c5eb97b2d0e8ac9893e1bf86 diff --git a/trunk/include/linux/kernel.h b/trunk/include/linux/kernel.h index 3fc9f5aab5f8..328bca609b9b 100644 --- a/trunk/include/linux/kernel.h +++ b/trunk/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