staging: iio: tsl2x7x_core: Fix standard deviation calculation
authorEva Rachel Retuya <eraretuya@gmail.com>
Mon, 20 Mar 2017 11:27:05 +0000 (19:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Jun 2017 05:06:18 +0000 (07:06 +0200)
commit51119b7a9ab9fe6d2459a654a1fa7d45460f7652
tree4635ff922369a8301dcadcb637cc00a06acad1b4
parent0b125e0a60a1b48e28784bda8d884251856a2686
staging: iio: tsl2x7x_core: Fix standard deviation calculation

commit cf6c77323a96fc40309cc8a4921ef206cccdd961 upstream.

Standard deviation is calculated as the square root of the variance
where variance is the mean of sample_sum and length. Correct the
computation of statP->stddev in accordance to the proper calculation.

Fixes: 3c97c08b5735 ("staging: iio: add TAOS tsl2x7x driver")
Reported-by: Abhiram Balasubramanian <abhiram@cs.utah.edu>
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/light/tsl2x7x_core.c