Re: [PATCH 1/1] iio: core: Fix fractional format generation

2019-08-21 Thread Lars-Peter Clausen
On 8/21/19 5:50 PM, Alexander Stein wrote: > In case the result is -0.3252 tmp0 is 0 after the div_s64_rem, so tmp0 is > non-negative which results in an output of 0.3252. > Fix this by explicitly handling the negative sign ourselves. Hi, Thanks for you patch. Some comments inline. > > Signed-o

[PATCH 1/1] iio: core: Fix fractional format generation

2019-08-21 Thread Alexander Stein
In case the result is -0.3252 tmp0 is 0 after the div_s64_rem, so tmp0 is non-negative which results in an output of 0.3252. Fix this by explicitly handling the negative sign ourselves. Signed-off-by: Alexander Stein --- drivers/iio/industrialio-core.c | 5 +++-- 1 file changed, 3 insertions(+),