All of lore.kernel.org
 help / color / mirror / Atom feed
* [sj:damon/next 34/46] mm/damon/core.c:1622:14: warning: no previous prototype for 'damon_moving_average'
@ 2023-08-30  6:36 kernel test robot
  2023-08-31  3:35 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-08-30  6:36 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:   15d82784a3f9e2e8a4c635de097a86ddc744845d
commit: 567e50270a93eccf0faaef76ec6e5443d7adb4b0 [34/46] mm/damon/core: implement a pseudo-moving average calculation function
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230830/202308301445.rW2NJlWP-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230830/202308301445.rW2NJlWP-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/202308301445.rW2NJlWP-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/damon/core.c:1622:14: warning: no previous prototype for 'damon_moving_average' [-Wmissing-prototypes]
    1622 | unsigned int damon_moving_average(unsigned int mvavg, unsigned int new_value,
         |              ^~~~~~~~~~~~~~~~~~~~


vim +/damon_moving_average +1622 mm/damon/core.c

  1600	
  1601	/*
  1602	 * damon_moving_average() - Calculate a pseudo-moving average value.
  1603	 * @mvavg:	Current value of the pseudo moving average.
  1604	 * @new_value:	New value that will be added to the pseudo moving average.
  1605	 * @len_widnow:	The length of the window of the moving average.
  1606	 *
  1607	 * Moving average is good for handling noise, but the cost of keeping the past
  1608	 * window values can be high for arbitrary window size.  This function
  1609	 * implements a lightweight pseudo moving average function that doesn't keep
  1610	 * the past window values.
  1611	 *
  1612	 * It simply assumes there was no noise in the past.  For example, if the
  1613	 * window length is 10 and current moving average value is 5, the last 10
  1614	 * values for the last window could be vary, e.g., 0, 10, 0, 10, 0, 10, 0, 10,
  1615	 * 0, 10.  This function simply assumes it got value 5 for each of the last ten
  1616	 * times.  Based on the assumption, when the next value is measured, it drops
  1617	 * 5/10 from the average value and add the new value divided by the window
  1618	 * length to get the updated pseduo-moving average.
  1619	 *
  1620	 * Return: Pseudo-moving average after getting the @new_value.
  1621	 */
> 1622	unsigned int damon_moving_average(unsigned int mvavg, unsigned int new_value,
  1623			unsigned int len_window)
  1624	{
  1625		return mvavg - mvavg / len_window + new_value / len_window;
  1626	}
  1627	

-- 
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-08-31  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30  6:36 [sj:damon/next 34/46] mm/damon/core.c:1622:14: warning: no previous prototype for 'damon_moving_average' kernel test robot
2023-08-31  3:35 ` 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.