Message ID | 20220718192844.1805158-6-yury.norov@gmail.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Introduce DEBUG_BITMAP config option and bitmap_check_params() | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
On Mon, Jul 18, 2022 at 12:28:33PM -0700, Yury Norov wrote: > CONFIG_DEBUG_BITMAP, when enabled, injects __bitmap_check_params() > into bitmap functions. It prevents compiler from compile-time > optimizations, which makes corresponding test fail. Does it stays the same for trace points?
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index bc48d992d10d..8bd279a7633f 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c @@ -877,6 +877,7 @@ static void __init test_bitmap_print_buf(void) static void __init test_bitmap_const_eval(void) { +#ifndef CONFIG_DEBUG_BITMAP DECLARE_BITMAP(bitmap, BITS_PER_LONG); unsigned long initvar = BIT(2); unsigned long bitopvar = 0; @@ -934,6 +935,7 @@ static void __init test_bitmap_const_eval(void) /* ~BIT(25) */ BUILD_BUG_ON(!__builtin_constant_p(~var)); BUILD_BUG_ON(~var != ~BIT(25)); +#endif } static void __init selftest(void)
CONFIG_DEBUG_BITMAP, when enabled, injects __bitmap_check_params() into bitmap functions. It prevents compiler from compile-time optimizations, which makes corresponding test fail. Signed-off-by: Yury Norov <yury.norov@gmail.com> --- lib/test_bitmap.c | 2 ++ 1 file changed, 2 insertions(+)