Re: [PATCH v5 2/8] iio: core: add fixed point parsing with 64-bit parts
From: Rodrigo Alencar
Date: Mon Jan 26 2026 - 10:00:56 EST
On 26/01/26 01:49PM, Andy Shevchenko wrote:
> On Fri, Jan 23, 2026 at 03:53:07PM +0000, Rodrigo Alencar via B4 Relay wrote:
>
> > Add iio_str_to_fixpoint64() function that leverages simple_strtoull()
> > to parse numbers from a string.
> > A helper function __iio_str_to_fixpoint64() replaces
> > __iio_str_to_fixpoint() implementation, extending its usage for
> > 64-bit fixed-point parsing.
>
> ...
>
> > +/**
> > + * __iio_str_to_fixpoint64() - Parse a fixed-point number from a string
> > + * @str: The string to parse
> > + * @fract_mult: Multiplier for the first decimal place, should be a power of 10
>
> > + * @integer: The integer part of the number
> > + * @fract: The fractional part of the number
>
> Can we use struct s64_fract? (Yes, you would need to add a couple of lines into
> math.h for that, but don't worry, I will Ack such a change immediately.)
Sorry, I missed this. s64_fract would be declared as:
struct s64_fract {
__s64 numerator;
__s64 denominator;
};
and numerator and denominator is not really applicable here. This type seems to be
used to declare fractions.
kind regards,
Rodrigo Alencar