lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v11 11/15] iio: test: add basic tests for the iio-rescale driver
On Wed, Dec 22, 2021 at 5:47 AM Liam Beguin <liambeguin@gmail.com> wrote:
>
> From: Liam Beguin <lvb@xiphos.com>
>
> The iio-rescale driver supports various combinations of scale types and
> offsets. These can often result in large integer multiplications. Make
> sure these calculations are done right by adding a set of kunit test
> cases that build on top of iio-test-format.

...

> + int fract_mult = 100000000LL;

Perhaps also change to use the prefix?

...

> + *nano = (s64)tmp * 10 * fract_mult + tmp2;

I'm also puzzled what the meaning of the 10 is here?

...

> + err = 1000000 * abs(exp - real);

Prefix?

...

> + err = div64_u64(err, abs(exp));
> + return (int)err;

return div64_u64();

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-12-22 13:41    [W:0.162 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site