Skip to contentSkip to conversation

mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here

PATCH kernel test robot 2 participants 2 messages Jul 5, 2025 DAMON

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
head:   9af2f87d23cb0b15f32e59e4e9da681454a46eab
commit: 405b04c2042a3448c2986c909608037f05a3bf0c [10/106] mm/damon: add trace event for effective size quota
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250705/[email protected]/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/[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]/

All warnings (new ones prefixed by >>):

>> mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here [-Wuninitialized]
    2023 |                 sidx++;
         |                 ^~~~
   mm/damon/core.c:2017:29: note: initialize the variable 'sidx' to silence this warning
    2017 |         unsigned int cidx = 0, sidx;
         |                                    ^
         |                                     = 0

1 warning generated.

vim +/sidx +2023 mm/damon/core.c

2013
2014 static void damos_trace_esz(struct damon_ctx *c, struct damos *s,
2015 struct damos_quota *quota)
2016 {
2017 unsigned int cidx = 0, sidx;
2018 struct damos *siter;
2019
2020 damon_for_each_scheme(siter, c) {
2021 if (siter == s)
2022 break;

> 2023			sidx++;

2024 }
2025 trace_damos_esz(cidx, sidx, quota->esz, true);
2026 }
2027

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#1 lore raw
Quoted 14 lines · On Sat, 5 Jul 2025 15:07:36 +0200 kernel test robot <[email protected]> wrote:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
head:   9af2f87d23cb0b15f32e59e4e9da681454a46eab
commit: 405b04c2042a3448c2986c909608037f05a3bf0c [10/106] mm/damon: add trace event for effective size quota
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250705/[email protected]/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/[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]/

All warnings (new ones prefixed by >>):

Quoted 8 lines
Quoted 1 line
Quoted 1 line

mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here [-Wuninitialized]

    2023 |                 sidx++;
         |                 ^~~~
   mm/damon/core.c:2017:29: note: initialize the variable 'sidx' to silence this warning
    2017 |         unsigned int cidx = 0, sidx;
         |                                    ^
         |                                     = 0

1 warning generated.

Thank you for this report! I just posted a fix:
https://lore.kernel.org/[email protected]

Thanks,
SJ

[...]