greybus: loopback: compute average stats on demand only
authorAlex Elder <elder@linaro.org>
Mon, 3 Aug 2015 17:57:19 +0000 (12:57 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 4 Aug 2015 03:12:50 +0000 (20:12 -0700)
commitff71d395f3cd5e5efe4b9b3c94c2d41581fb9d8c
treee45903c17f8a3d2365188f9ede1c4ac360393808
parent7a135a965c62f7abdf8f3acc5ca45a03d27b272c
greybus: loopback: compute average stats on demand only

Stop recording and updating the average every time a sample
is recorded.  Instead, compute it from the sum and count only
when it's required.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c