From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:37654 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbdFRBFh (ORCPT ); Sat, 17 Jun 2017 21:05:37 -0400 Subject: Patch "staging: iio: tsl2x7x_core: Fix standard deviation calculation" has been added to the 4.11-stable tree To: eraretuya@gmail.com, abhiram@cs.utah.edu, gregkh@linuxfoundation.org, jic23@kernel.org Cc: , From: Date: Sun, 18 Jun 2017 09:03:44 +0800 Message-ID: <149774782425412@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled staging: iio: tsl2x7x_core: Fix standard deviation calculation to the 4.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-iio-tsl2x7x_core-fix-standard-deviation-calculation.patch and it can be found in the queue-4.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From cf6c77323a96fc40309cc8a4921ef206cccdd961 Mon Sep 17 00:00:00 2001 From: Eva Rachel Retuya Date: Mon, 20 Mar 2017 19:27:05 +0800 Subject: staging: iio: tsl2x7x_core: Fix standard deviation calculation From: Eva Rachel Retuya 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 Signed-off-by: Eva Rachel Retuya Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/light/tsl2x7x_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/iio/light/tsl2x7x_core.c +++ b/drivers/staging/iio/light/tsl2x7x_core.c @@ -854,7 +854,7 @@ void tsl2x7x_prox_calculate(int *data, i tmp = data[i] - statP->mean; sample_sum += tmp * tmp; } - statP->stddev = int_sqrt((long)sample_sum) / length; + statP->stddev = int_sqrt((long)sample_sum / length); } /** Patches currently in stable-queue which might be from eraretuya@gmail.com are queue-4.11/staging-iio-tsl2x7x_core-fix-standard-deviation-calculation.patch