Skip to contentSkip to conversation

mm/kasan/kasan_test.c:36:6: sparse: sparse: symbol 'kasan_ptr_result' was not declared. Should it be static?

DISCUSSION kernel test robot 1 participant 1 message Dec 26, 2023 Memory management

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fbafc3e621c3f4ded43720fdb1d6ce1728ec664e
commit: f7e01ab828fd4bf6d25b1f143a3994241e8572bf kasan: move tests to mm/kasan/
date:   1 year, 3 months ago
config: x86_64-randconfig-122-20231101 (https://download.01.org/0day-ci/archive/20231226/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231226/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> mm/kasan/kasan_test.c:36:6: sparse: sparse: symbol 'kasan_ptr_result' was not declared. Should it be static?
>> mm/kasan/kasan_test.c:37:5: sparse: sparse: symbol 'kasan_int_result' was not declared. Should it be static?

vim +/kasan_ptr_result +36 mm/kasan/kasan_test.c

f33a01492a24a2 lib/test_kasan.c Walter Wu        2020-08-06  31  
adb72ae1915db2 lib/test_kasan.c Daniel Axtens    2020-06-03  32  /*
0fd379253691e7 lib/test_kasan.c Andrey Konovalov 2021-02-24  33   * Some tests use these global variables to store return values from function
0fd379253691e7 lib/test_kasan.c Andrey Konovalov 2021-02-24  34   * calls that could otherwise be eliminated by the compiler as dead code.
adb72ae1915db2 lib/test_kasan.c Daniel Axtens    2020-06-03  35   */

adb72ae1915db2 lib/test_kasan.c Daniel Axtens 2020-06-03 @36 void *kasan_ptr_result;
83c4e7a0363bdb lib/test_kasan.c Patricia Alfonso 2020-10-13 @37 int kasan_int_result; 83c4e7a0363bdb lib/test_kasan.c Patricia Alfonso 2020-10-13 38

:::::: The code at line 36 was first introduced by commit
:::::: adb72ae1915db28f934e9e02c18bfcea2f3ed3b7 kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

:::::: TO: Daniel Axtens <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki