llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here
@ 2025-07-05  9:17 kernel test robot
  2025-07-05 17:23 ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2025-07-05  9:17 UTC (permalink / raw)
  To: SeongJae Park; +Cc: llvm, oe-kbuild-all

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-buildonly-randconfig-003-20250705 (https://download.01.org/0day-ci/archive/20250705/202507051740.hrB8EaUH-lkp@intel.com/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/202507051740.hrB8EaUH-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507051740.hrB8EaUH-lkp@intel.com/

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	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here
@ 2025-07-05 13:07 kernel test robot
  2025-07-05 17:21 ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2025-07-05 13:07 UTC (permalink / raw)
  To: SeongJae Park; +Cc: llvm, oe-kbuild-all

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/202507051517.bs3jd8RW-lkp@intel.com/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/202507051517.bs3jd8RW-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507051517.bs3jd8RW-lkp@intel.com/

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	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here
  2025-07-05 13:07 kernel test robot
@ 2025-07-05 17:21 ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2025-07-05 17:21 UTC (permalink / raw)
  To: kernel test robot; +Cc: SeongJae Park, llvm, oe-kbuild-all, damon

On Sat, 5 Jul 2025 15:07:36 +0200 kernel test robot <lkp@intel.com> 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/202507051517.bs3jd8RW-lkp@intel.com/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/202507051517.bs3jd8RW-lkp@intel.com/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 <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202507051517.bs3jd8RW-lkp@intel.com/
> 
> 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.

Thank you for this report!  I just posted a fix:
https://lore.kernel.org/20250705172003.52324-1-sj@kernel.org


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here
  2025-07-05  9:17 [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here kernel test robot
@ 2025-07-05 17:23 ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2025-07-05 17:23 UTC (permalink / raw)
  To: kernel test robot; +Cc: SeongJae Park, llvm, oe-kbuild-all, damon

On Sat, 5 Jul 2025 17:17:03 +0800 kernel test robot <lkp@intel.com> 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-buildonly-randconfig-003-20250705 (https://download.01.org/0day-ci/archive/20250705/202507051740.hrB8EaUH-lkp@intel.com/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/202507051740.hrB8EaUH-lkp@intel.com/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 <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202507051740.hrB8EaUH-lkp@intel.com/
> 
> 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.

Seems this is a duplicate of another one[1].  Please refer to my reply to that
one[1].

[1] https://lore.kernel.org/202507051517.bs3jd8RW-lkp@intel.com


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-05 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-05  9:17 [sj:damon/next 10/106] mm/damon/core.c:2023:3: warning: variable 'sidx' is uninitialized when used here kernel test robot
2025-07-05 17:23 ` SeongJae Park
  -- strict thread matches above, loose matches on Subject: below --
2025-07-05 13:07 kernel test robot
2025-07-05 17:21 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).