lkml.org 
[lkml]   [2019]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/6] lib/test_bitmap: switch test_bitmap_parselist to ktime_get()
Date
test_bitmap_parselist uses get_cycles(). Only arm, arm64, openrisc,
riscv and sparc64 implement get_cycles() and others take a stub from
include/asm-generic/timex.h.

So, switch to more generic ktime_get().

Fixes: 6df0d464dbcc1a55 (lib/test_bitmap.c: add test for bitmap_parselist())
Signed-off-by: Yury Norov <ynorov@marvell.com>
---
lib/test_bitmap.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 6cd7d0740005..b06e0fd3811b 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -266,15 +266,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",
@@ -291,8 +291,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);
}
}

--
2.17.1
\
 
 \ /
  Last update: 2019-03-25 22:09    [W:0.097 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site