Re: [PATCH 1/2] units: Add the HZ_PER_KHZ macro

From: Andrew Morton
Date: Wed Mar 03 2021 - 20:11:37 EST


On Wed, 24 Feb 2021 10:39:36 +0200 Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Wednesday, February 24, 2021, Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> wrote:
>
> >
> >
> > On Tuesday, February 23, 2021, Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
> > wrote:
> >
> >> The macro for the unit conversion for frequency is duplicated in
> >> different places.
> >>
> >> Provide this macro in the 'units' header, so it can be reused.
> >>
> >>
> >
> > Thanks! That was the idea behind my reviews to add those definitions
> > explicitly in the users. I just want to be sure you covered them all. Also
> > there are few non-standard names for above in some drivers (they can be
> > fixed on per driver basis in separate patches though).
> >
> >
>
> Seems you introduced a common macro and forget about dropping it elsewhere.
>
> https://elixir.bootlin.com/linux/latest/A/ident/HZ_PER_MHZ

Yes. And HZ_PER_KHZ.

Also, why make them signed types? Negative Hz is physically
nonsensical. If that upsets some code somewhere because it was dealing
with signed types then, well, that code needed fixing anyway.

Ditto MILLIWATT_PER_WATT and friends, sigh.