aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Norov <[email protected]>2019-05-14 15:43:18 -0700
committerLinus Torvalds <[email protected]>2019-05-14 19:52:49 -0700
commit0c2111a5c852aa0ded7c5644a58058df80ed58bb (patch)
tree2aacb9374ff2dbbc50a69885f3b28bf085e6b85b
parente371c481d89cd6b9db72e077efd64059dfc87711 (diff)
lib/test_bitmap: switch test_bitmap_parselist to ktime_get()
test_bitmap_parselist currently uses get_cycles which is not implemented on some platforms, so use ktime_get() instead. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Yury Norov <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Kees Cook <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Mike Travis <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--lib/test_bitmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 792d90608052..63d4a21955f0 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -268,15 +268,15 @@ static void __init test_bitmap_parselist(void)
{
int i;
int err;
- cycles_t cycles;
+ ktime_t time;
DECLARE_BITMAP(bmap, 2048);
for (i = 0; i < ARRAY_SIZE(parselist_tests); i++) {
#define ptest parselist_tests[i]
- cycles = get_cycles();
+ time = ktime_get();
err = bitmap_parselist(ptest.in, bmap, ptest.nbits);
- cycles = get_cycles() - cycles;
+ time = ktime_get() - time;
if (err != ptest.errno) {
pr_err("test %d: input is %s, errno is %d, expected %d\n",
@@ -293,8 +293,7 @@ static void __init test_bitmap_parselist(void)
if (ptest.flags & PARSE_TIME)
pr_err("test %d: input is '%s' OK, Time: %llu\n",
- i, ptest.in,
- (unsigned long long)cycles);
+ i, ptest.in, time);
}
}