* + units-complement-the-set-of-hz-units.patch added to mm-nonmm-unstable branch
@ 2022-08-11 23:12 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-08-11 23:12 UTC (permalink / raw)
To: mm-commits, wsa, michael.hennerich, lars, jic23, jbhayana,
ddrokosov, daniel.lezcano, andy.shevchenko, andriy.shevchenko,
DDRokosov, akpm
The patch titled
Subject: units: complement the set of Hz units
has been added to the -mm mm-nonmm-unstable branch. Its filename is
units-complement-the-set-of-hz-units.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/units-complement-the-set-of-hz-units.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Dmitry Rokosov <DDRokosov@sberdevices.ru>
Subject: units: complement the set of Hz units
Date: Mon, 1 Aug 2022 14:37:25 +0000
Patch series "units: complement the set of Hz units", v3.
During msa311 accel IIO driver development
https://lore.kernel.org/linux-iio/20220616104211.9257-1-ddrokosov@sberdevices.ru/
Andy requested to use proper units in the hz->ms calculation. Current
units.h header doesn't have milli, micro and nano HZ coefficients, so some
drivers (in the IIO subsystem) implement their own copies for that.
The current patchset resolves such a problem and intoduces general
MILLIHZ_PER_HZ, MICROHZ_PER_HZ and NANOHZ_PER_HZ definitions in the
units.h, and fixes all drivers which duplicate these units.
This patch (of 3):
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.
Link: https://lkml.kernel.org/r/20220801143811.14817-1-ddrokosov@sberdevices.ru
Link: https://lkml.kernel.org/r/20220801143811.14817-2-ddrokosov@sberdevices.ru
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Wolfram Sang <wsa@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Jyoti Bhayana <jbhayana@google.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/units.h | 3 +++
1 file changed, 3 insertions(+)
--- a/include/linux/units.h~units-complement-the-set-of-hz-units
+++ a/include/linux/units.h
@@ -20,6 +20,9 @@
#define PICO 1000000000000ULL
#define FEMTO 1000000000000000ULL
+#define NANOHZ_PER_HZ 1000000000UL
+#define MICROHZ_PER_HZ 1000000UL
+#define MILLIHZ_PER_HZ 1000UL
#define HZ_PER_KHZ 1000UL
#define KHZ_PER_MHZ 1000UL
#define HZ_PER_MHZ 1000000UL
_
Patches currently in -mm which might be from DDRokosov@sberdevices.ru are
units-complement-the-set-of-hz-units.patch
iio-accel-adxl345-use-hz-macro-from-unitsh.patch
iio-common-scmi_sensors-use-hz-macro-from-unitsh.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-11 23:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11 23:12 + units-complement-the-set-of-hz-units.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.