summaryrefslogtreecommitdiffstats
path: root/include/common.h
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2015-01-29 11:14:05 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2015-01-29 08:48:30 +0100
commita07a472cac72d336574c438358bbf3c113b16fb5 (patch)
tree4f5f7734a8adb1606319acc83f6115df73053166 /include/common.h
parentbfa1b12fed600b621057d347f083e620aeced9a7 (diff)
downloadbarebox-a07a472cac72d336574c438358bbf3c113b16fb5.tar.gz
barebox-a07a472cac72d336574c438358bbf3c113b16fb5.tar.xz
linux/bug.h: move BUILD_BUG_ON*() macros
In Linux, the macros BUILD_BUG_ON* are defined in include/linux/bug.h. To tidy up common.h, move BUILD_BUG_* there. MAYBE_BUILD_BUG_ON is not used in barebox and it was removed from Linux long time ago. Drop it from barebox, too. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/include/common.h b/include/common.h
index f3f5c0fcac..c30f6bd735 100644
--- a/include/common.h
+++ b/include/common.h
@@ -27,6 +27,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
+#include <linux/bug.h>
#include <linux/stddef.h>
#include <asm/common.h>
#include <printk.h>
@@ -175,25 +176,6 @@ static inline char *shell_expand(char *str)
}
#endif
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
-
-/* 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 aren't permitted).
- */
-#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
-#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
-
#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
#define ALIGN_DOWN(x, a) ((x) & ~((typeof(x))(a) - 1))