]> git.baikalelectronics.ru Git - kernel.git/commit
average: provide macro to create static EWMA
authorJohannes Berg <johannes.berg@intel.com>
Mon, 13 Jul 2015 10:17:25 +0000 (12:17 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 14 Aug 2015 15:49:52 +0000 (17:49 +0200)
commit7f0a844f697114b57841717b78950f78c4f853be
tree1ab7ba67a7ef1a70f84808c7ac3eed8bd6c6376f
parentab2124585cb4928fd2247243ce79394aadcdf320
average: provide macro to create static EWMA

Having the EWMA parameters stored in the runtime struct imposes
memory requirements for the constant values that could just be
inlined in the code. This particularly makes sense if there are
a lot of such structs, for example in mac80211 in the station
table where each station has a number of these in an array, and
there can be many stations.

Provide a macro DECLARE_EWMA() that declares the necessary struct
and inline functions to access it with the parameters hard-coded;
using this also means the user no longer needs to 'select AVERAGE'
as it's entirely self-contained.

In the mac80211 case, on x86-64, this actually slightly *reduces*
code size, while also saving 80 bytes of runtime memory per sta.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/average.h