[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202311030119.b4CdX9Kv-lkp@intel.com>
Date: Fri, 3 Nov 2023 01:44:39 +0800
From: kernel test robot <lkp@...el.com>
To: Daniel Hill <daniel@...o.nz>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Kent Overstreet <kmo@...erainc.com>
Subject: fs/bcachefs/mean_and_variance.c:78: warning: Function parameter or
member 's1' not described in 'mean_and_variance_get_variance'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 21e80f3841c01aeaf32d7aee7bbc87b3db1aa0c6
commit: 92095781e0f607e735971c1a6462ca6dad8826d2 bcachefs: Mean and variance
date: 11 days ago
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20231103/202311030119.b4CdX9Kv-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231103/202311030119.b4CdX9Kv-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311030119.b4CdX9Kv-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/bcachefs/mean_and_variance.c:67: warning: Function parameter or member 's' not described in 'mean_and_variance_get_mean'
>> fs/bcachefs/mean_and_variance.c:78: warning: Function parameter or member 's1' not described in 'mean_and_variance_get_variance'
>> fs/bcachefs/mean_and_variance.c:94: warning: Function parameter or member 's' not described in 'mean_and_variance_get_stddev'
>> fs/bcachefs/mean_and_variance.c:108: warning: Function parameter or member 's' not described in 'mean_and_variance_weighted_update'
fs/bcachefs/mean_and_variance.c:108: warning: Function parameter or member 'x' not described in 'mean_and_variance_weighted_update'
fs/bcachefs/mean_and_variance.c:108: warning: Excess function parameter 's1' description in 'mean_and_variance_weighted_update'
fs/bcachefs/mean_and_variance.c:108: warning: Excess function parameter 's2' description in 'mean_and_variance_weighted_update'
fs/bcachefs/mean_and_variance.c:134: warning: Function parameter or member 's' not described in 'mean_and_variance_weighted_get_mean'
fs/bcachefs/mean_and_variance.c:143: warning: Function parameter or member 's' not described in 'mean_and_variance_weighted_get_variance'
fs/bcachefs/mean_and_variance.c:153: warning: Function parameter or member 's' not described in 'mean_and_variance_weighted_get_stddev'
vim +78 fs/bcachefs/mean_and_variance.c
71
72 /**
73 * mean_and_variance_get_variance() - get variance from @s1
74 *
75 * see linked pdf equation 12.
76 */
77 u64 mean_and_variance_get_variance(struct mean_and_variance s1)
> 78 {
79 if (s1.n) {
80 u128_u s2 = u128_div(s1.sum_squares, s1.n);
81 u64 s3 = abs(mean_and_variance_get_mean(s1));
82
83 return u128_lo(u128_sub(s2, u128_square(s3)));
84 } else {
85 return 0;
86 }
87 }
88 EXPORT_SYMBOL_GPL(mean_and_variance_get_variance);
89
90 /**
91 * mean_and_variance_get_stddev() - get standard deviation from @s
92 */
93 u32 mean_and_variance_get_stddev(struct mean_and_variance s)
> 94 {
95 return int_sqrt64(mean_and_variance_get_variance(s));
96 }
97 EXPORT_SYMBOL_GPL(mean_and_variance_get_stddev);
98
99 /**
100 * mean_and_variance_weighted_update() - exponentially weighted variant of mean_and_variance_update()
101 * @s1: ..
102 * @s2: ..
103 *
104 * see linked pdf: function derived from equations 140-143 where alpha = 2^w.
105 * values are stored bitshifted for performance and added precision.
106 */
107 void mean_and_variance_weighted_update(struct mean_and_variance_weighted *s, s64 x)
> 108 {
109 // previous weighted variance.
110 u8 w = s->weight;
111 u64 var_w0 = s->variance;
112 // new value weighted.
113 s64 x_w = x << w;
114 s64 diff_w = x_w - s->mean;
115 s64 diff = fast_divpow2(diff_w, w);
116 // new mean weighted.
117 s64 u_w1 = s->mean + diff;
118
119 if (!s->init) {
120 s->mean = x_w;
121 s->variance = 0;
122 } else {
123 s->mean = u_w1;
124 s->variance = ((var_w0 << w) - var_w0 + ((diff_w * (x_w - u_w1)) >> w)) >> w;
125 }
126 s->init = true;
127 }
128 EXPORT_SYMBOL_GPL(mean_and_variance_weighted_update);
129
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists