Skip to content

Commit a4d89b1

Browse files
Satya Priya Kakitapallibebarino
authored andcommitted
clk: qcom: clk-alpha-pll: Simplify the zonda_pll_adjust_l_val()
In zonda_pll_adjust_l_val() replace the divide operator with comparison operator to fix below build error and smatch warning. drivers/clk/qcom/clk-alpha-pll.o: In function `clk_zonda_pll_set_rate': clk-alpha-pll.c:(.text+0x45dc): undefined reference to `__aeabi_uldivmod' smatch warnings: drivers/clk/qcom/clk-alpha-pll.c:2129 zonda_pll_adjust_l_val() warn: replace divide condition '(remainder * 2) / prate' with '(remainder * 2) >= prate' Fixes: f497313 ("clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL") Reported-by: Jon Hunter <jonathanh@nvidia.com> Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202408110724.8pqbpDiD-lkp@intel.com/ Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com> Link: https://lore.kernel.org/r/20240906113905.641336-1-quic_skakitap@quicinc.com Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 71c03a8 commit a4d89b1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/clk/qcom/clk-alpha-pll.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,10 +2124,8 @@ static void zonda_pll_adjust_l_val(unsigned long rate, unsigned long prate, u32
21242124

21252125
quotient = rate;
21262126
remainder = do_div(quotient, prate);
2127-
*l = quotient;
21282127

2129-
if ((remainder * 2) / prate)
2130-
*l = *l + 1;
2128+
*l = rate + (u32)(remainder * 2 >= prate);
21312129
}
21322130

21332131
static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,

0 commit comments

Comments
 (0)