Skip to content

Commit b961b65

Browse files
Li Zetaobebarino
authored andcommitted
clk: tegra: use clamp() in tegra_bpmp_clk_determine_rate()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Thierry Reding <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent d22e5f9 commit b961b65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/tegra/clk-bpmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int tegra_bpmp_clk_determine_rate(struct clk_hw *hw,
174174
unsigned long rate;
175175
int err;
176176

177-
rate = min(max(rate_req->rate, rate_req->min_rate), rate_req->max_rate);
177+
rate = clamp(rate_req->rate, rate_req->min_rate, rate_req->max_rate);
178178

179179
memset(&request, 0, sizeof(request));
180180
request.rate = min_t(u64, rate, S64_MAX);

0 commit comments

Comments
 (0)