Re: [PATCH v1 1/3] math.h: Add mult_fract() that takes struct __Txx_fract as argument
From: Joshua Crofts
Date: Wed Nov 18 2026 - 04:56:44 EST
On Wed, 18 Nov 2026 11:45:18 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> On Wed, Nov 18, 2026 at 09:22:29AM +0100, Joshua Crofts wrote:
> > On Tue, 17 Nov 2026 10:14:40 +0100
> > Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> >
> > > Add mult_fract() that takes struct __Txx_fract as argument and
> > > calls do_div() instead of plain divisions.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > > ---
> > > include/linux/math.h | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/include/linux/math.h b/include/linux/math.h
> > > index 1e8fb3efbc8c..ded258df50df 100644
> > > --- a/include/linux/math.h
> > > +++ b/include/linux/math.h
> > > @@ -128,6 +128,10 @@ __STRUCT_FRACT(u32)
> > > q * n_ + r * n_ / d_; \
> > > })
> > >
> > > +/* Same as above but for a struct __Txx_fract fraction */
> > > +#define mult_fract(x, f) \
> > > + mult_frac(x, (f)->numerator, (f)->denominator)
> > > +
> > > #define sector_div(a, b) do_div(a, b)
> >
> > Sashiko has some remarks.
>
> Strange that I have got no email on that...
Yeah, for IIO Sashiko doesn't send emails, only if a patch series touches
any dt-bindings stuff (new drivers etc.).
--
Kind regards,
Joshua Crofts