Re: [PATCH 2/2] lib: add test for bitmap_parselist()

From: Andrew Morton
Date: Wed Aug 09 2017 - 16:28:57 EST


On Wed, 9 Aug 2017 12:11:15 +0800 kbuild test robot <lkp@xxxxxxxxx> wrote:

> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.13-rc4 next-20170808]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Yury-Norov/lib-make-bitmap_parselist-thread-safe-and-much-faster/20170809-105307
> config: xtensa-allmodconfig (attached as .config)
> compiler: xtensa-linux-gcc (GCC) 4.9.0
> reproduce:
> wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=xtensa
>
> All warnings (new ones prefixed by >>):
>
> lib/test_bitmap.c:180:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> 0xfffffffe, 0x3333333311111111, 0xffffffff77777777};
> ^
> lib/test_bitmap.c:180:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> lib/test_bitmap.c:181:1: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> static const unsigned long exp2[] = {0x3333333311111111, 0xffffffff77777777};
> ^
> lib/test_bitmap.c:181:1: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> lib/test_bitmap.c: In function 'test_bitmap_parselist':
> >> lib/test_bitmap.c:235:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'cycles_t' [-Wformat=]
> pr_err("test %d: input is '%s' OK, Time: %lu\n",
> ^

Maybe we need a %p thingy for printing cycles_t. But this will do:

--- a/lib/test_bitmap.c~lib-add-test-for-bitmap_parselist-fix
+++ a/lib/test_bitmap.c
@@ -232,8 +232,9 @@ static void __init test_bitmap_parselist
}

if (ptest.flags & PARSE_TIME)
- pr_err("test %d: input is '%s' OK, Time: %lu\n",
- i, ptest.in, cycles);
+ pr_err("test %d: input is '%s' OK, Time: %llu\n",
+ i, ptest.in,
+ (unsigned long long)cycles);
}
}

_