All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: SeongJae Park <sj@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [sj:damon/next 34/46] mm/damon/core.c:1622:14: warning: no previous prototype for 'damon_moving_average'
Date: Wed, 30 Aug 2023 14:36:08 +0800	[thread overview]
Message-ID: <202308301445.rW2NJlWP-lkp@intel.com> (raw)

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

             reply	other threads:[~2023-08-30  6:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  6:36 kernel test robot [this message]
2023-08-31  3:35 ` [sj:damon/next 34/46] mm/damon/core.c:1622:14: warning: no previous prototype for 'damon_moving_average' SeongJae Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202308301445.rW2NJlWP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.