Skip to content

Commit 6c7bc7d

Browse files
committed
clk: renesas: div6: Use clamp() instead of clamp_t()
As "div" is already "unsigned int", adding "U" suffixes to the constants "1" and "64" allows us to replace the call to clamp_t() by a call to clamp(). This removes hidden casts, and thus helps the compiler doing a better job at type-checking. Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/2670c1e3c82a245666578cbbd1fb20d37932fd8e.1617281699.git.geert+renesas@glider.be
1 parent a20a40a commit 6c7bc7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/renesas/clk-div6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static unsigned int cpg_div6_clock_calc_div(unsigned long rate,
9999
rate = 1;
100100

101101
div = DIV_ROUND_CLOSEST(parent_rate, rate);
102-
return clamp_t(unsigned int, div, 1, 64);
102+
return clamp(div, 1U, 64U);
103103
}
104104

105105
static long cpg_div6_clock_round_rate(struct clk_hw *hw, unsigned long rate,

0 commit comments

Comments
 (0)