Searched refs:avg (Results 1 – 1 of 1) sorted by relevance
37 void ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight) in ewma_init() argument41 avg->weight = ilog2(weight); in ewma_init()42 avg->factor = ilog2(factor); in ewma_init()43 avg->internal = 0; in ewma_init()54 struct ewma *ewma_add(struct ewma *avg, unsigned long val) in ewma_add() argument56 avg->internal = avg->internal ? in ewma_add()57 (((avg->internal << avg->weight) - avg->internal) + in ewma_add()58 (val << avg->factor)) >> avg->weight : in ewma_add()59 (val << avg->factor); in ewma_add()60 return avg; in ewma_add()