Re: [PATCH v15 1/2] math.h: provide rounddown_ull variant for rounddown MACRO
From: Andy Shevchenko
Date: Tue Jun 24 2025 - 04:41:22 EST
On Tue, Jun 24, 2025 at 09:45:08AM +0200, Christian Marangi wrote:
> On Tue, Jun 24, 2025 at 09:08:32AM +0300, Andy Shevchenko wrote:
> > On Tue, Jun 24, 2025 at 12:11 AM Christian Marangi <ansuelsmth@xxxxxxxxx> wrote:
...
> > rounddown(),
>
> For this and the other... Is it correct to use () for MACRO?
> I assume () should be used only for functions.
When it takes argument, yes. When it doesn't then you don't put it.
...
> > rounddown_ull()
Btw, I don't like name for this, it's better to be in math64 with the u64 or similar suffixes like it's used for div/mul variants.
Also add a roundup to make the API symmetrical (yes, it's okay that it has no
users, it's a macro and doesn't consume memory at run-time).
...
> > > - Add this patch
> >
> > Why are math64 APIs not usable here?
>
> There isn't a rounddown API for math64.
Then implementing it there (in math64.h) looks to me natural thingy that will
implicitly suggest this.
--
With Best Regards,
Andy Shevchenko