summaryrefslogtreecommitdiff
path: root/drivers/clk/renesas
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-04-01 16:01:34 +0300
committerGeert Uytterhoeven <geert+renesas@glider.be>2021-05-11 10:58:12 +0300
commit6c7bc7dbcc4122745a214134749a0b1ab2658c80 (patch)
treeacddaa1a65ea8b0399471997046b7415f62bd71a /drivers/clk/renesas
parenta20a40a8bbc2cf4b29d7248ea31e974e9103dd7f (diff)
downloadlinux-6c7bc7dbcc4122745a214134749a0b1ab2658c80.tar.xz
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 <geert+renesas@glider.be> Link: https://lore.kernel.org/r/2670c1e3c82a245666578cbbd1fb20d37932fd8e.1617281699.git.geert+renesas@glider.be
Diffstat (limited to 'drivers/clk/renesas')
-rw-r--r--drivers/clk/renesas/clk-div6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/renesas/clk-div6.c b/drivers/clk/renesas/clk-div6.c
index 8fb68e703a6b..a3c4fbeb7b0d 100644
--- a/drivers/clk/renesas/clk-div6.c
+++ b/drivers/clk/renesas/clk-div6.c
@@ -99,7 +99,7 @@ static unsigned int cpg_div6_clock_calc_div(unsigned long rate,
rate = 1;
div = DIV_ROUND_CLOSEST(parent_rate, rate);
- return clamp_t(unsigned int, div, 1, 64);
+ return clamp(div, 1U, 64U);
}
static long cpg_div6_clock_round_rate(struct clk_hw *hw, unsigned long rate,