Commit 0c2111a5 authored by Yury Norov's avatar Yury Norov Committed by Linus Torvalds

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/20190405173211.11373-4-ynorov@marvell.comSigned-off-by: default avatarYury Norov <ynorov@marvell.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Travis <travis@sgi.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e371c481
...@@ -268,15 +268,15 @@ static void __init test_bitmap_parselist(void) ...@@ -268,15 +268,15 @@ static void __init test_bitmap_parselist(void)
{ {
int i; int i;
int err; int err;
cycles_t cycles; ktime_t time;
DECLARE_BITMAP(bmap, 2048); DECLARE_BITMAP(bmap, 2048);
for (i = 0; i < ARRAY_SIZE(parselist_tests); i++) { for (i = 0; i < ARRAY_SIZE(parselist_tests); i++) {
#define ptest parselist_tests[i] #define ptest parselist_tests[i]
cycles = get_cycles(); time = ktime_get();
err = bitmap_parselist(ptest.in, bmap, ptest.nbits); err = bitmap_parselist(ptest.in, bmap, ptest.nbits);
cycles = get_cycles() - cycles; time = ktime_get() - time;
if (err != ptest.errno) { if (err != ptest.errno) {
pr_err("test %d: input is %s, errno is %d, expected %d\n", pr_err("test %d: input is %s, errno is %d, expected %d\n",
...@@ -293,8 +293,7 @@ static void __init test_bitmap_parselist(void) ...@@ -293,8 +293,7 @@ static void __init test_bitmap_parselist(void)
if (ptest.flags & PARSE_TIME) if (ptest.flags & PARSE_TIME)
pr_err("test %d: input is '%s' OK, Time: %llu\n", pr_err("test %d: input is '%s' OK, Time: %llu\n",
i, ptest.in, i, ptest.in, time);
(unsigned long long)cycles);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment