Re: [PATCH] Optimize int_sqrt for small values for faster idle
From: kbuild test robot
Date: Thu Jan 28 2016 - 17:05:49 EST
Hi Andi,
[auto build test WARNING on v4.5-rc1]
[also build test WARNING on next-20160128]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Andi-Kleen/Optimize-int_sqrt-for-small-values-for-faster-idle/20160129-054629
config: x86_64-randconfig-x015-01270835 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
lib/int_sqrt.c: In function 'int_sqrt':
>> lib/int_sqrt.c:25:6: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (m <= 0xff)
^
vim +/m +25 lib/int_sqrt.c
9 #include <linux/export.h>
10
11 /**
12 * int_sqrt - rough approximation to sqrt
13 * @x: integer of which to calculate the sqrt
14 *
15 * A very rough approximation to the sqrt() function.
16 */
17 unsigned long int_sqrt(unsigned long x)
18 {
19 unsigned long b, m, y = 0;
20
21 if (x <= 1)
22 return x;
23
24 if (x <= 0xffff) {
> 25 if (m <= 0xff)
26 m = 1UL << (8 - 2);
27 else
28 m = 1UL << (16 - 2);
29 } else if (x <= 0xffffffff)
30 m = 1UL << (32 - 2);
31 else
32 m = 1UL << (BITS_PER_LONG - 2);
33 while (m != 0) {
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data