Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sj:damon/next 60/63] mm/damon/core.c:1339:16: warning: variable 'nr_regions' set but not used
@ 2025-01-29 16:08 kernel test robot
  2025-01-29 18:26 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-01-29 16:08 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:   db09358b42a2d75f76c297d9eedceeb9786c96fd
commit: dcd0807d5a93d6e7b64f63de86de810f55a19bfb [60/63] mm/damon: intervals tuning parameters refactoring
config: s390-randconfig-001-20250129 (https://download.01.org/0day-ci/archive/20250130/202501300041.usRaByZc-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 19306351a2c45e266fa11b41eb1362b20b6ca56d)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250130/202501300041.usRaByZc-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/202501300041.usRaByZc-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/damon/core.c:1351:65: warning: more '%' conversions than data arguments [-Wformat-insufficient-args]
    1351 |         pr_info("access_samples %lu/%lu, score_bp %lu, adaptation bp %lu\n",
         |                                                                      ~~^
   include/linux/printk.h:574:26: note: expanded from macro 'pr_info'
     574 |         printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |                                 ^~~
   mm/damon/core.c:8:31: note: expanded from macro 'pr_fmt'
       8 | #define pr_fmt(fmt) "damon: " fmt
         |                               ^~~
   include/linux/printk.h:501:53: note: expanded from macro 'printk'
     501 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ^~~
   include/linux/printk.h:473:11: note: expanded from macro 'printk_index_wrap'
     473 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ^~~~
>> mm/damon/core.c:1339:16: warning: variable 'nr_regions' set but not used [-Wunused-but-set-variable]
    1339 |         unsigned long nr_regions = 0, access_samples = 0, score_bp;
         |                       ^
   mm/damon/core.c:1358:31: warning: unused variable 'sample_to_aggr_bp' [-Wunused-variable]
    1358 |         unsigned long adaptation_bp, sample_to_aggr_bp;
         |                                      ^~~~~~~~~~~~~~~~~
   3 warnings generated.


vim +/nr_regions +1339 mm/damon/core.c

  1331	
  1332	static unsigned long damon_feed_loop_next_input(unsigned long last_input,
  1333			unsigned long score);
  1334	
  1335	static unsigned long damon_get_intervals_adaptation_bp(struct damon_ctx *c)
  1336	{
  1337		struct damon_target *t;
  1338		struct damon_region *r;
> 1339		unsigned long nr_regions = 0, access_samples = 0, score_bp;
  1340		unsigned long adaptation_bp;
  1341	
  1342		damon_for_each_target(t, c) {
  1343			nr_regions += damon_nr_regions(t);
  1344			damon_for_each_region(r, t)
  1345				access_samples += r->nr_accesses;
  1346		}
  1347		score_bp = access_samples * 10000 / c->attrs.intervals_goal.samples;
  1348		adaptation_bp = damon_feed_loop_next_input(100000000, score_bp) /
  1349			10000;
  1350	
  1351		pr_info("access_samples %lu/%lu, score_bp %lu, adaptation bp %lu\n",
  1352				access_samples, score_bp, adaptation_bp);
  1353		return adaptation_bp;
  1354	}
  1355	

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

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

* Re: [sj:damon/next 60/63] mm/damon/core.c:1339:16: warning: variable 'nr_regions' set but not used
  2025-01-29 16:08 [sj:damon/next 60/63] mm/damon/core.c:1339:16: warning: variable 'nr_regions' set but not used kernel test robot
@ 2025-01-29 18:26 ` SeongJae Park
  0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2025-01-29 18:26 UTC (permalink / raw)
  To: kernel test robot; +Cc: SeongJae Park, llvm, oe-kbuild-all

On Thu, 30 Jan 2025 00:08:39 +0800 kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> head:   db09358b42a2d75f76c297d9eedceeb9786c96fd
> commit: dcd0807d5a93d6e7b64f63de86de810f55a19bfb [60/63] mm/damon: intervals tuning parameters refactoring
> config: s390-randconfig-001-20250129 (https://download.01.org/0day-ci/archive/20250130/202501300041.usRaByZc-lkp@intel.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 19306351a2c45e266fa11b41eb1362b20b6ca56d)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250130/202501300041.usRaByZc-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/202501300041.usRaByZc-lkp@intel.com/

Thank you for the kind report always.  Just pushed a fix as commit f9be0d7542dc
("mm/damon/core: fix set but not used 'nr_regions' in
damon_get_intervals_adaptation_bp()") on the tree (damon/next), with the above
two tags.


Thanks,
SJ

[...]

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

end of thread, other threads:[~2025-01-29 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 16:08 [sj:damon/next 60/63] mm/damon/core.c:1339:16: warning: variable 'nr_regions' set but not used kernel test robot
2025-01-29 18:26 ` SeongJae Park

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