public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [sj:damon/next 156/181] mm/damon/paddr.c:195:7: warning: variable 'matched' is used uninitialized whenever 'if' condition is false
@ 2026-04-20 19:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-20 19:16 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:   ecd4906478687820c088904becbcf3c80ded7d81
commit: 8c863600a03e3066ce88bf8db48953176befa4c4 [156/181] mm/damon/paddr: do data_attr filtering
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260421/202604210331.wdB3yt0y-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260421/202604210331.wdB3yt0y-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/202604210331.wdB3yt0y-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/damon/paddr.c:195:7: warning: variable 'matched' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     195 |                 if (f->type == DAMON_FILTER_TYPE_ANON) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/damon/paddr.c:203:7: note: uninitialized use occurs here
     203 |                 if (matched)
         |                     ^~~~~~~
   mm/damon/paddr.c:195:3: note: remove the 'if' if its condition is always true
     195 |                 if (f->type == DAMON_FILTER_TYPE_ANON) {
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/damon/paddr.c:193:15: note: initialize the variable 'matched' to silence this warning
     193 |                 bool matched;
         |                             ^
         |                              = 0
   1 warning generated.


vim +195 mm/damon/paddr.c

   186	
   187	static bool damon_pa_is_attr(phys_addr_t pa, struct damon_data_attr *a)
   188	{
   189		struct damon_filter *f;
   190		bool default_allow = true;
   191	
   192		damon_for_each_filter(f, a) {
   193			bool matched;
   194	
 > 195			if (f->type == DAMON_FILTER_TYPE_ANON) {
   196				struct folio *folio = damon_get_folio(PHYS_PFN(pa));
   197	
   198				if (!folio)
   199					matched = false;
   200				else
   201					matched = folio_test_anon(folio);
   202			}
   203			if (matched)
   204				return f->allow;
   205			default_allow = !f->allow;
   206		}
   207		return default_allow;
   208	}
   209	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-20 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 19:16 [sj:damon/next 156/181] mm/damon/paddr.c:195:7: warning: variable 'matched' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox