Re: [PATCH v6] lib: add basic KUnit test for lib/math
From: kernel test robot
Date: Sat Apr 17 2021 - 02:02:14 EST
Hi Daniel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 7e25f40eab52c57ff6772d27d2aef3640a3237d7]
url: https://github.com/0day-ci/linux/commits/Daniel-Latypov/lib-add-basic-KUnit-test-for-lib-math/20210417-020619
base: 7e25f40eab52c57ff6772d27d2aef3640a3237d7
config: powerpc-randconfig-c004-20210416 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/0f1888ffeaa6baa1bc2a99eac8ba7d1df29c8450
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Daniel-Latypov/lib-add-basic-KUnit-test-for-lib-math/20210417-020619
git checkout 0f1888ffeaa6baa1bc2a99eac8ba7d1df29c8450
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
lib/math/math_kunit.c: In function 'abs_test':
>> lib/math/math_kunit.c:41:1: warning: the frame size of 1088 bytes is larger than 1024 bytes [-Wframe-larger-than=]
41 | }
| ^
vim +41 lib/math/math_kunit.c
14
15 static void abs_test(struct kunit *test)
16 {
17 KUNIT_EXPECT_EQ(test, abs((char)0), (char)0);
18 KUNIT_EXPECT_EQ(test, abs((char)42), (char)42);
19 KUNIT_EXPECT_EQ(test, abs((char)-42), (char)42);
20
21 /* The expression in the macro is actually promoted to an int. */
22 KUNIT_EXPECT_EQ(test, abs((short)0), 0);
23 KUNIT_EXPECT_EQ(test, abs((short)42), 42);
24 KUNIT_EXPECT_EQ(test, abs((short)-42), 42);
25
26 KUNIT_EXPECT_EQ(test, abs(0), 0);
27 KUNIT_EXPECT_EQ(test, abs(42), 42);
28 KUNIT_EXPECT_EQ(test, abs(-42), 42);
29
30 KUNIT_EXPECT_EQ(test, abs(0L), 0L);
31 KUNIT_EXPECT_EQ(test, abs(42L), 42L);
32 KUNIT_EXPECT_EQ(test, abs(-42L), 42L);
33
34 KUNIT_EXPECT_EQ(test, abs(0LL), 0LL);
35 KUNIT_EXPECT_EQ(test, abs(42LL), 42LL);
36 KUNIT_EXPECT_EQ(test, abs(-42LL), 42LL);
37
38 /* Unsigned types get casted to signed. */
39 KUNIT_EXPECT_EQ(test, abs(0ULL), 0LL);
40 KUNIT_EXPECT_EQ(test, abs(42ULL), 42LL);
> 41 }
42
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip