Skip to content

Commit 34e42e9

Browse files
nunojsabebarino
authored andcommitted
clk: clk-axi-clkgen move to min/max()
Instead of using the type versions of min/max(), use the plain ones as now they are perfectly capable of handling different types like unsigned and non negative integers that are compiletime constant. Signed-off-by: Nuno Sá <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: David Lechner <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 236ab6a commit 34e42e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/clk/clk-axi-clkgen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ static void axi_clkgen_calc_params(const struct axi_clkgen_limits *limits,
147147
*best_m = 0;
148148
*best_dout = 0;
149149

150-
d_min = max_t(unsigned long, DIV_ROUND_UP(fin, limits->fpfd_max), 1);
151-
d_max = min_t(unsigned long, fin / limits->fpfd_min, 80);
150+
d_min = max(DIV_ROUND_UP(fin, limits->fpfd_max), 1);
151+
d_max = min(fin / limits->fpfd_min, 80);
152152

153153
again:
154154
fvco_min_fract = limits->fvco_min << fract_shift;
155155
fvco_max_fract = limits->fvco_max << fract_shift;
156156

157-
m_min = max_t(unsigned long, DIV_ROUND_UP(fvco_min_fract, fin) * d_min, 1);
158-
m_max = min_t(unsigned long, fvco_max_fract * d_max / fin, 64 << fract_shift);
157+
m_min = max(DIV_ROUND_UP(fvco_min_fract, fin) * d_min, 1);
158+
m_max = min(fvco_max_fract * d_max / fin, 64 << fract_shift);
159159

160160
for (m = m_min; m <= m_max; m++) {
161161
_d_min = max(d_min, DIV_ROUND_UP(fin * m, fvco_max_fract));

0 commit comments

Comments
 (0)