]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
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)
committerSeth Forshee <seth.forshee@canonical.com>
Sun, 25 Jun 2017 15:36:43 +0000 (10:36 -0500)
commit6ee785ad3f7931000b965771456bad16ce4b7068
tree1cd66eca1637c7a7633a5b04b36f037d3a160833
parent9654e15a0545f0f4dd92167d1764b83ad43e739b
staging: iio: tsl2x7x_core: Fix standard deviation calculation

BugLink: http://bugs.launchpad.net/bugs/1700372
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/staging/iio/light/tsl2x7x_core.c