public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: clk-alpha-pll: Replace divide operator with comparison
@ 2024-08-13  9:40 Satya Priya Kakitapalli
  2024-08-13 20:01 ` Vladimir Zapolskiy
  0 siblings, 1 reply; 9+ messages in thread
From: Satya Priya Kakitapalli @ 2024-08-13  9:40 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd
  Cc: linux-arm-msm, linux-clk, linux-kernel, Ajit Pandey, Imran Shaik,
	Taniya Das, Jagadeesh Kona, Satya Priya Kakitapalli,
	kernel test robot, Dan Carpenter

In zonda_pll_adjust_l_val() replace the divide operator with comparison
operator since comparisons are faster than divisions.

Fixes: f4973130d255 ("clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL")
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>
---
 drivers/clk/qcom/clk-alpha-pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index 2f620ccb41cb..fd8a82bb3690 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -2126,7 +2126,7 @@ static void zonda_pll_adjust_l_val(unsigned long rate, unsigned long prate, u32
 	remainder = do_div(quotient, prate);
 	*l = quotient;
 
-	if ((remainder * 2) / prate)
+	if ((remainder * 2) >= prate)
 		*l = *l + 1;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-06 11:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13  9:40 [PATCH] clk: qcom: clk-alpha-pll: Replace divide operator with comparison Satya Priya Kakitapalli
2024-08-13 20:01 ` Vladimir Zapolskiy
2024-08-28 13:47   ` Jon Hunter
2024-08-28 20:44     ` Dmitry Baryshkov
2024-08-29  9:14       ` Dan Carpenter
2024-08-30  5:33     ` Satya Priya Kakitapalli
2024-09-04 21:26       ` Jon Hunter
2024-09-05 10:58         ` Satya Priya Kakitapalli
2024-09-06 11:07   ` Satya Priya Kakitapalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox