public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] units: Add the HZ_PER_KHZ macro
@ 2021-02-23 20:30 Daniel Lezcano
  2021-02-23 20:30 ` [PATCH 2/2] units: Use " Daniel Lezcano
       [not found] ` <CAHp75VcJwoye5KOYXF3Fs1F-82JPP-7VaU4z5OqBrYDr+AGQ5w@mail.gmail.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Lezcano @ 2021-02-23 20:30 UTC (permalink / raw)
  To: rafael; +Cc: Andrew Morton, Andy Shevchenko, Lukasz Luba, open list

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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/units.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/units.h b/include/linux/units.h
index dcc30a53fa93..218ec0d314b6 100644
--- a/include/linux/units.h
+++ b/include/linux/units.h
@@ -4,6 +4,10 @@
 
 #include <linux/math.h>
 
+#define HZ_PER_KHZ		1000L
+#define KHZ_PER_MHZ		1000L
+#define HZ_PER_MHZ		1000000L
+
 #define MILLIWATT_PER_WATT	1000L
 #define MICROWATT_PER_MILLIWATT	1000L
 #define MICROWATT_PER_WATT	1000000L
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-05  1:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-23 20:30 [PATCH 1/2] units: Add the HZ_PER_KHZ macro Daniel Lezcano
2021-02-23 20:30 ` [PATCH 2/2] units: Use " Daniel Lezcano
2021-02-23 20:36   ` Christian Eggers
2021-02-24  6:25   ` Chanwoo Choi
     [not found] ` <CAHp75VcJwoye5KOYXF3Fs1F-82JPP-7VaU4z5OqBrYDr+AGQ5w@mail.gmail.com>
     [not found]   ` <CAHp75Vcqug9qC_ejHE03YguiSy-XpsZV6g36-pe3VOFgTS2-tA@mail.gmail.com>
2021-03-04  0:31     ` [PATCH 1/2] units: Add " Andrew Morton
2021-03-04  9:38       ` Andy Shevchenko
2021-03-04 12:41       ` Daniel Lezcano
2021-03-05  1:21         ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox