lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/16] lib/test_bitmap: disable compile-time test if DEBUG_BITMAP() is enabled
Date
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(+)

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)
--
2.34.1
\
 
 \ /
  Last update: 2022-07-18 21:30    [W:0.249 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site