Re: [PATCH v1 1/3] math.h: Add mult_fract() that takes struct __Txx_fract as argument

From: Andy Shevchenko

Date: Wed Nov 18 2026 - 04:45:29 EST


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...

> https://sashiko.dev/#/patchset/20261117091638.1463621-1-andriy.shevchenko%40linux.intel.com

Ah, yes, the commit message is stale, I need to make it up to date.

--
With Best Regards,
Andy Shevchenko