projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d22e5f9
)
clk: tegra: use clamp() in tegra_bpmp_clk_determine_rate()
author
Li Zetao
<lizetao1@huawei.com>
Fri, 30 Aug 2024 01:23:44 +0000
(09:23 +0800)
committer
Stephen Boyd
<sboyd@kernel.org>
Mon, 28 Oct 2024 17:33:13 +0000
(10:33 -0700)
When it needs to get a value within a certain interval, using clamp()
makes the code easier to understand than min(max()).
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link:
https://lore.kernel.org/r/20240830012344.603704-1-lizetao1@huawei.com
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/tegra/clk-bpmp.c
patch
|
blob
|
history
diff --git
a/drivers/clk/tegra/clk-bpmp.c
b/drivers/clk/tegra/clk-bpmp.c
index
7bfba0a
..
b2323cb
100644
(file)
--- a/
drivers/clk/tegra/clk-bpmp.c
+++ b/
drivers/clk/tegra/clk-bpmp.c
@@
-174,7
+174,7
@@
static int tegra_bpmp_clk_determine_rate(struct clk_hw *hw,
unsigned long rate;
int err;
- rate =
min(max(rate_req->rate, rate_req->min_rate)
, rate_req->max_rate);
+ rate =
clamp(rate_req->rate, rate_req->min_rate
, rate_req->max_rate);
memset(&request, 0, sizeof(request));
request.rate = min_t(u64, rate, S64_MAX);