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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210816114732.1834145-3-daniel.lezcano@linaro.org>
Date:   Mon, 16 Aug 2021 13:47:24 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     andriy.shevchenko@...ux.intel.com, akpm@...ux-foundation.org
Cc:     jic23@...nel.org, linux-kernel@...r.kernel.org, ceggers@...i.de,
        lukasz.luba@....com, myungjoo.ham@...sung.com,
        kyungmin.park@...sung.com, lars@...afoo.de, pmeerw@...erw.net,
        rui.zhang@...el.com, linux@...ck-us.net, miquel.raynal@...tlin.com,
        mcoquelin.stm32@...il.com, rafael@...nel.org,
        daniel.lezcano@...aro.org
Subject: [PATCH v3 02/10] units: Add the HZ macros

The macros for the unit conversion for frequency are duplicated in
different places.

Provide these macros in the 'units' header, so they can be reused.

Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
Reviewed-by: Christian Eggers <ceggers@...i.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 include/linux/units.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/units.h b/include/linux/units.h
index ff51d3cfc6a0..8b8dc8a84d93 100644
--- a/include/linux/units.h
+++ b/include/linux/units.h
@@ -4,6 +4,10 @@
 
 #include <linux/math.h>
 
+#define HZ_PER_KHZ		1000UL
+#define KHZ_PER_MHZ		1000UL
+#define HZ_PER_MHZ		1000000UL
+
 #define MILLIWATT_PER_WATT	1000UL
 #define MICROWATT_PER_MILLIWATT	1000UL
 #define MICROWATT_PER_WATT	1000000UL
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ