All of lore.kernel.org
 help / color / mirror / Atom feed
* [sj:damon/next 33/35] mm/damon/core.c:290:1: error: function declaration isn't a prototype
@ 2023-07-01 16:55 kernel test robot
  2023-07-01 17:33 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-07-01 16:55 UTC (permalink / raw)
  To: SeongJae Park; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
head:   b5a2d90d9d7d15714ca1dfb7bb74043ebd2a28d0
commit: 0389f4cef6f76094d3b2aed5bece0a4036dd859c [33/35] mm/damon/core: Implement moving_nr_accesses update function
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230702/202307020030.tSDmtlai-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230702/202307020030.tSDmtlai-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/202307020030.tSDmtlai-lkp@intel.com/

Note: the sj/damon/next HEAD b5a2d90d9d7d15714ca1dfb7bb74043ebd2a28d0 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

>> mm/damon/core.c:290:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
     290 | static unsigned int damon_pseudo_moving_average_add(unsigned int current,
         | ^~~~~~
   mm/damon/core.c: In function 'damon_record_access_to_region':
>> mm/damon/core.c:320:25: error: 'max_nr_accesses' undeclared (first use in this function)
     320 |                         max_nr_accesses);
         |                         ^~~~~~~~~~~~~~~
   mm/damon/core.c:320:25: note: each undeclared identifier is reported only once for each function it appears in
   mm/damon/core.c:318:31: warning: passing argument 1 of 'damon_pseudo_moving_average_add' makes pointer from integer without a cast [-Wint-conversion]
     318 |                         region->moving_accesses_bp,
         |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~
         |                               |
         |                               unsigned int
   In file included from include/linux/sched.h:12,
                    from include/linux/cgroup.h:12,
                    from include/linux/memcontrol.h:13,
                    from include/linux/damon.h:11,
                    from mm/damon/core.c:10:
   arch/x86/include/asm/current.h:44:17: note: expected 'unsigned int (*)()' but argument is of type 'unsigned int'
      44 | #define current get_current()
   mm/damon/core.c:290:66: note: in expansion of macro 'current'
     290 | static unsigned int damon_pseudo_moving_average_add(unsigned int current,
         |                                                                  ^~~~~~~
   cc1: some warnings being treated as errors


vim +290 mm/damon/core.c

   276	
   277	/*
   278	 * damon_pseudo_moving_average_add() - Return pseudo-moving average value.
   279	 * @current:	Current value of the pseudo moving average.
   280	 * @delta:	New value that will be added to the pseudo moving average/
   281	 * @len_widnow:	The length of the window of the moving average.
   282	 *
   283	 * Moving average is good for handling noise, but the cost of keeping the past
   284	 * window values can be high for arbitrary window size.  This function
   285	 * implements lightweight pseudo moving average function, which doesn't keep
   286	 * the past window values, but assumes the there was no noise in the past.
   287	 *
   288	 * Return: Pseudo-moving average after getting the @delta.
   289	 */
 > 290	static unsigned int damon_pseudo_moving_average_add(unsigned int current,
   291			unsigned int delta, unsigned int len_window)
   292	{
   293		return current - current / len_window + delta;
   294	}
   295	
   296	/**
   297	 * damon_record_access_to_region() - Apply access finding for a region.
   298	 * @region:	The DAMON region to update its access frequency.
   299	 * @accessed:	Whether the region has accessed.
   300	 * @attrs:	The monitoring attributes.
   301	 *
   302	 * Apply found access or idleness to a region by updating the access rate
   303	 * fields of the region.  Normally called by underlying operations set to apply
   304	 * each of their access check results to a each region.
   305	 */
   306	void damon_record_access_to_region(struct damon_region *region, bool accessed,
   307			struct damon_attrs *attrs)
   308	{
   309		unsigned int len_window = 1;
   310	
   311		/*
   312		 * sample_interval can be zero, but cannot be larger than
   313		 * aggr_interval, owing to validation of damon_set_attrs().
   314		 */
   315		if (attrs->sample_interval)
   316			len_window = attrs->aggr_interval / attrs->sample_interval;
   317		region->moving_accesses_bp = damon_pseudo_moving_average_add(
   318				region->moving_accesses_bp,
   319				accessed ? 10000 / len_window : 0,
 > 320				max_nr_accesses);
   321	
   322		region->nr_accesses += accessed ? 1 : 0;
   323	}
   324	

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

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

end of thread, other threads:[~2023-07-01 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-01 16:55 [sj:damon/next 33/35] mm/damon/core.c:290:1: error: function declaration isn't a prototype kernel test robot
2023-07-01 17:33 ` SeongJae Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.