aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-01-24 15:45:10 -0500
committerRusty Russell <rusty@rustcorp.com.au>2011-01-23 23:15:11 -0500
commit1765e3a4933ea0870fabd755feffc5473c4363ce (patch)
tree208364f2933f96773310a3a6c4dce6a21f66eec7 /include/linux
parent7ef88ad561457c0346355dfd1f53e503ddfde719 (diff)
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kmemcheck.h2
-rw-r--r--include/linux/virtio_config.h5
4 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index a3b148a91874..0b84c61607e8 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -249,7 +249,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
249 ((1 << ZONES_SHIFT) - 1); 249 ((1 << ZONES_SHIFT) - 1);
250 250
251 if (__builtin_constant_p(bit)) 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 else { 253 else {
254#ifdef CONFIG_DEBUG_VM 254#ifdef CONFIG_DEBUG_VM
255 BUG_ON((GFP_ZONE_BAD >> bit) & 1); 255 BUG_ON((GFP_ZONE_BAD >> bit) & 1);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 864712f3653d..e2f4d6af2125 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -611,7 +611,6 @@ extern int __build_bug_on_failed;
611 if (condition) __build_bug_on_failed = 1; \ 611 if (condition) __build_bug_on_failed = 1; \
612 } while(0) 612 } while(0)
613#endif 613#endif
614#define MAYBE_BUILD_BUG_ON(condition) BUILD_BUG_ON(condition)
615 614
616/* Trap pasters of __FUNCTION__ at compile-time */ 615/* Trap pasters of __FUNCTION__ at compile-time */
617#define __FUNCTION__ (__func__) 616#define __FUNCTION__ (__func__)
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
index 08d7dc4ddf40..39f8453239f7 100644
--- a/include/linux/kmemcheck.h
+++ b/include/linux/kmemcheck.h
@@ -76,7 +76,7 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size);
76 \ 76 \
77 _n = (long) &((ptr)->name##_end) \ 77 _n = (long) &((ptr)->name##_end) \
78 - (long) &((ptr)->name##_begin); \ 78 - (long) &((ptr)->name##_begin); \
79 MAYBE_BUILD_BUG_ON(_n < 0); \ 79 BUILD_BUG_ON(_n < 0); \
80 \ 80 \
81 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ 81 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
82 } while (0) 82 } while (0)
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 0093dd7c1d6f..800617b4ddd5 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -109,7 +109,10 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
109 unsigned int fbit) 109 unsigned int fbit)
110{ 110{
111 /* Did you forget to fix assumptions on max features? */ 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 if (fbit < VIRTIO_TRANSPORT_F_START) 117 if (fbit < VIRTIO_TRANSPORT_F_START)
115 virtio_check_driver_offered_feature(vdev, fbit); 118 virtio_check_driver_offered_feature(vdev, fbit);