Commit 1765e3a4933ea0870fabd755feffc5473c4363ce
1 parent
7ef88ad561
Exists in
master
and in
4 other branches
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
include/linux/gfp.h
include/linux/kernel.h
include/linux/kmemcheck.h
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); |