Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-10 Thread Andreas Klinger
> On Fri, Apr 7, 2017 at 12:27 PM, Andreas Klinger wrote: > > Hi Matt, > > > > i've extracted the error condition in a small userspace application for > > demonstration. Just compile and see that in this case the variable H3 is > > zero > > but the whole term evaluates differently if treated as u

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-08 Thread Matt Ranostay
On Fri, Apr 7, 2017 at 12:27 PM, Andreas Klinger wrote: > Hi Matt, > > i've extracted the error condition in a small userspace application for > demonstration. Just compile and see that in this case the variable H3 is zero > but the whole term evaluates differently if treated as unsigned or signed

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-07 Thread Andreas Klinger
Hi Matt, i've extracted the error condition in a small userspace application for demonstration. Just compile and see that in this case the variable H3 is zero but the whole term evaluates differently if treated as unsigned or signed. The whole example including the values of the variables are tak

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-06 Thread Matt Ranostay
On Mon, Apr 3, 2017 at 11:16 PM, Matt Ranostay wrote: > On Sun, Apr 2, 2017 at 10:29 AM, Andreas Klinger wrote: >> Linus Walleij schrieb am Sun, 02. Apr 16:56: >>> On Sun, Apr 2, 2017 at 11:32 AM, Jonathan Cameron wrote: >>> > On 27/03/17 11:06, Andreas Klinger wrote: >>> >> While calculating t

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-03 Thread Matt Ranostay
On Sun, Apr 2, 2017 at 10:29 AM, Andreas Klinger wrote: > Linus Walleij schrieb am Sun, 02. Apr 16:56: >> On Sun, Apr 2, 2017 at 11:32 AM, Jonathan Cameron wrote: >> > On 27/03/17 11:06, Andreas Klinger wrote: >> >> While calculating the compensation of the humidity there are negative >> >> valu

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-02 Thread Jonathan Cameron
On 2 April 2017 18:29:49 BST, Andreas Klinger wrote: >Linus Walleij schrieb am Sun, 02. Apr 16:56: >> On Sun, Apr 2, 2017 at 11:32 AM, Jonathan Cameron >wrote: >> > On 27/03/17 11:06, Andreas Klinger wrote: >> >> While calculating the compensation of the humidity there are >negative >> >> valu

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-02 Thread Andreas Klinger
Linus Walleij schrieb am Sun, 02. Apr 16:56: > On Sun, Apr 2, 2017 at 11:32 AM, Jonathan Cameron wrote: > > On 27/03/17 11:06, Andreas Klinger wrote: > >> While calculating the compensation of the humidity there are negative > >> values interpreted as unsigned because of unsigned variables used.

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-02 Thread Linus Walleij
On Sun, Apr 2, 2017 at 11:32 AM, Jonathan Cameron wrote: > On 27/03/17 11:06, Andreas Klinger wrote: >> While calculating the compensation of the humidity there are negative >> values interpreted as unsigned because of unsigned variables used. >> These values need to be casted to signed as indicat

Re: [PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-04-02 Thread Jonathan Cameron
On 27/03/17 11:06, Andreas Klinger wrote: > While calculating the compensation of the humidity there are negative > values interpreted as unsigned because of unsigned variables used. > These values need to be casted to signed as indicated by the documentation > of the sensor. > > Signed-off-by: An

[PATCH] IIO: bmp280-core.c: fix error in humidity calculation

2017-03-27 Thread Andreas Klinger
While calculating the compensation of the humidity there are negative values interpreted as unsigned because of unsigned variables used. These values need to be casted to signed as indicated by the documentation of the sensor. Signed-off-by: Andreas Klinger --- drivers/iio/pressure/bmp280-core.c