lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220731124140.777ddd05@jic23-huawei>
Date:   Sun, 31 Jul 2022 12:41:55 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Dmitry Rokosov <DDRokosov@...rdevices.ru>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
        "wsa@...nel.org" <wsa@...nel.org>,
        "lars@...afoo.de" <lars@...afoo.de>,
        "Michael.Hennerich@...log.com" <Michael.Hennerich@...log.com>,
        "jbhayana@...gle.com" <jbhayana@...gle.com>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        kernel <kernel@...rdevices.ru>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/3] units: complement the set of Hz units

On Fri, 29 Jul 2022 20:02:42 +0200
Andy Shevchenko <andy.shevchenko@...il.com> wrote:

> On Fri, Jul 29, 2022 at 7:23 PM Dmitry Rokosov <DDRokosov@...rdevices.ru> wrote:
> >
> > Currently, Hz units do not have milli, micro and nano Hz coefficients.
> > Some drivers (IIO especially) use their analogues to calculate
> > appropriate Hz values. This patch includes them to units.h definitions,
> > so they can be used from different kernel places.  
> 
> ...
> 
> > +#define NHZ_PER_HZ             1000000000UL
> > +#define UHZ_PER_HZ             1000000UL
> > +#define MILLIHZ_PER_HZ         1000UL  
> 
> Oh, but then a bit of consistency?
> 
> MICRO
> NANO
Tricky given existing items, but I agree we shouldn't make
it worse.

However, I'm not 100% sold on why we need these conversions relative to HZ.
What's wrong with using MILLI / NANO etc as already defined?  I guess
there is a 'documentation' like effect of making it clear these are frequency
unit conversions, but I don't think it makes sense to add it for all the other
types of unit, so why is Hz special?

I'm not sure why we have the existing ones for HZ with the
exception of KHZ_PER_MEGAHZ.

Jonathan

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ