lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Feb 2019 12:10:42 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Mike Looijmans <mike.looijmans@...ic.nl>
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net
Subject: Re: [PATCH v2] iio/gyro/bmg160: Use millidegrees for temperature
 scale

On Wed, 13 Feb 2019 08:41:47 +0100
Mike Looijmans <mike.looijmans@...ic.nl> wrote:

> Standard unit for temperature is millidegrees Celcius, whereas this driver
> was reporting in degrees. Fix the scale factor in the driver.
> 
> Signed-off-by: Mike Looijmans <mike.looijmans@...ic.nl>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan
> ---
> v2: Don't touch val2 when returning IIO_VAL_INT
>     Only touch val when returning a value
> 
>  drivers/iio/gyro/bmg160_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
> index 63ca316..92c07ab 100644
> --- a/drivers/iio/gyro/bmg160_core.c
> +++ b/drivers/iio/gyro/bmg160_core.c
> @@ -582,11 +582,10 @@ static int bmg160_read_raw(struct iio_dev *indio_dev,
>  	case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
>  		return bmg160_get_filter(data, val);
>  	case IIO_CHAN_INFO_SCALE:
> -		*val = 0;
>  		switch (chan->type) {
>  		case IIO_TEMP:
> -			*val2 = 500000;
> -			return IIO_VAL_INT_PLUS_MICRO;
> +			*val = 500;
> +			return IIO_VAL_INT;
>  		case IIO_ANGL_VEL:
>  		{
>  			int i;
> @@ -594,6 +593,7 @@ static int bmg160_read_raw(struct iio_dev *indio_dev,
>  			for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) {
>  				if (bmg160_scale_table[i].dps_range ==
>  							data->dps_range) {
> +					*val = 0;
>  					*val2 = bmg160_scale_table[i].scale;
>  					return IIO_VAL_INT_PLUS_MICRO;
>  				}

Powered by blists - more mailing lists