]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/bug.h
mm: Some arch may want to use HPAGE_PMD related values as variables
[mirror_ubuntu-artful-kernel.git] / include / linux / bug.h
index 7f4818673c41f80d391faee5ea1667435d7bbf84..e51b0709e78dce274a915cf9fbd16c80f70b6b94 100644 (file)
@@ -20,6 +20,7 @@ struct pt_regs;
 #define BUILD_BUG_ON_MSG(cond, msg) (0)
 #define BUILD_BUG_ON(condition) (0)
 #define BUILD_BUG() (0)
+#define MAYBE_BUILD_BUG_ON(cond) (0)
 #else /* __CHECKER__ */
 
 /* Force a compilation error if a constant expression is not a power of 2 */
@@ -83,6 +84,14 @@ struct pt_regs;
  */
 #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
 
+#define MAYBE_BUILD_BUG_ON(cond)                       \
+       do {                                            \
+               if (__builtin_constant_p((cond)))       \
+                       BUILD_BUG_ON(cond);             \
+               else                                    \
+                       BUG_ON(cond);                   \
+       } while (0)
+
 #endif /* __CHECKER__ */
 
 #ifdef CONFIG_GENERIC_BUG