Commit 1765e3a4933ea0870fabd755feffc5473c4363ce

Authored by Rusty Russell
1 parent 7ef88ad561

Remove MAYBE_BUILD_BUG_ON

Now BUILD_BUG_ON() can handle optimizable constants, we don't need
MAYBE_BUILD_BUG_ON any more.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 4 changed files with 6 additions and 4 deletions Side-by-side Diff

... ... @@ -249,7 +249,7 @@
249 249 ((1 << ZONES_SHIFT) - 1);
250 250  
251 251 if (__builtin_constant_p(bit))
252   - MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
  252 + BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
253 253 else {
254 254 #ifdef CONFIG_DEBUG_VM
255 255 BUG_ON((GFP_ZONE_BAD >> bit) & 1);
include/linux/kernel.h
... ... @@ -611,7 +611,6 @@
611 611 if (condition) __build_bug_on_failed = 1; \
612 612 } while(0)
613 613 #endif
614   -#define MAYBE_BUILD_BUG_ON(condition) BUILD_BUG_ON(condition)
615 614  
616 615 /* Trap pasters of __FUNCTION__ at compile-time */
617 616 #define __FUNCTION__ (__func__)
include/linux/kmemcheck.h
... ... @@ -76,7 +76,7 @@
76 76 \
77 77 _n = (long) &((ptr)->name##_end) \
78 78 - (long) &((ptr)->name##_begin); \
79   - MAYBE_BUILD_BUG_ON(_n < 0); \
  79 + BUILD_BUG_ON(_n < 0); \
80 80 \
81 81 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
82 82 } while (0)
include/linux/virtio_config.h
... ... @@ -109,7 +109,10 @@
109 109 unsigned int fbit)
110 110 {
111 111 /* Did you forget to fix assumptions on max features? */
112   - MAYBE_BUILD_BUG_ON(fbit >= 32);
  112 + if (__builtin_constant_p(fbit))
  113 + BUILD_BUG_ON(fbit >= 32);
  114 + else
  115 + BUG_ON(fbit >= 32);
113 116  
114 117 if (fbit < VIRTIO_TRANSPORT_F_START)
115 118 virtio_check_driver_offered_feature(vdev, fbit);