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: <20250812-clk-tests-docs-v3-2-054aed58dcd3@redhat.com>
Date: Tue, 12 Aug 2025 10:40:32 -0400
From: Brian Masney <bmasney@...hat.com>
To: Michael Turquette <mturquette@...libre.com>, 
 Stephen Boyd <sboyd@...nel.org>, Maxime Ripard <mripard@...nel.org>
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Brian Masney <bmasney@...hat.com>
Subject: [PATCH v3 2/9] clk: test: introduce clk_dummy_rate_mhz()

Some of the mock tests care about the relationship between two
different rates to ensure that functionality in the clk core is
exercised when the parent rate is negotiated by using specific
rates. Introduce clk_dummy_rate_mhz() to improve readability.
Change the DUMMY_CLOCK_* rate constants over to use this.

Signed-off-by: Brian Masney <bmasney@...hat.com>
---
 drivers/clk/clk_test.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk_test.c b/drivers/clk/clk_test.c
index a268d7b5d4cb28ec1f029f828c31107f8e130556..fafa736ca32144a2feae75a8d641abca3162d42d 100644
--- a/drivers/clk/clk_test.c
+++ b/drivers/clk/clk_test.c
@@ -21,9 +21,10 @@
 
 static const struct clk_ops empty_clk_ops = { };
 
-#define DUMMY_CLOCK_INIT_RATE	(42 * 1000 * 1000)
-#define DUMMY_CLOCK_RATE_1	(142 * 1000 * 1000)
-#define DUMMY_CLOCK_RATE_2	(242 * 1000 * 1000)
+#define clk_dummy_rate_mhz(rate)	((rate) * 1000 * 1000)
+#define DUMMY_CLOCK_INIT_RATE		clk_dummy_rate_mhz(42)
+#define DUMMY_CLOCK_RATE_1		clk_dummy_rate_mhz(142)
+#define DUMMY_CLOCK_RATE_2		clk_dummy_rate_mhz(242)
 
 struct clk_dummy_context {
 	struct clk_hw hw;

-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ