Lines Matching refs:ap
82 static inline void avg_update(struct avg_info *ap, __u64 t)
84 if (ap->n++ == 0)
85 ap->min = ap->total = ap->max = t;
87 if (t < ap->min)
88 ap->min = t;
89 else if (t > ap->max)
90 ap->max = t;
91 ap->total += t;
95 static inline void avg_update_n(struct avg_info *ap, __u64 t, int n)
97 if (ap->n == 0) {
98 ap->min = ap->max = t;
99 ap->total = (n * t);
101 if (t < ap->min)
102 ap->min = t;
103 else if (t > ap->max)
104 ap->max = t;
105 ap->total += (n * t);
108 ap->n += n;
111 static inline void avg_unupdate(struct avg_info *ap, __u64 t)
113 ap->n--;
114 ap->total -= t;