Skip to contentSkip to conversation

include/linux/genl_magic_func.h: remove own BUILD_BUG_ON*() defines

PATCH New [email protected] 1 participant 1 message Feb 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 77/114 include/linux/genl_magic_func.h: remove own BUILD_BUG_ON*() defines

From: Masahiro Yamada <[email protected]>
Subject: include/linux/genl_magic_func.h: remove own BUILD_BUG_ON*() defines

Do not duplicate BUILD_BUG_ON*. Use ones from <linux/build_bug.h>.

---

 include/linux/genl_magic_func.h |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
include/linux/genl_magic_func.h renamed from include/linux/genl_magic_func.h~genl_magic-remove-own-build_bug_on-defines +1 -10
diff -puN include/linux/genl_magic_func.h~genl_magic-remove-own-build_bug_on-defines include/linux/genl_magic_func.h
@@ -2,6 +2,7 @@
 #ifndef GENL_MAGIC_FUNC_H
 #define GENL_MAGIC_FUNC_H
 
+#include <linux/build_bug.h>
 #include <linux/genl_magic_struct.h>
 
 /*
@@ -132,17 +133,6 @@ static void dprint_array(const char *dir
  * use one static buffer for parsing of nested attributes */
 static struct nlattr *nested_attr_tb[128];
 
-#ifndef BUILD_BUG_ON
-/* 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 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); }))
-#endif