mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: i.MX clk-pllv2: Do not use a negative value for the unsigned variable
@ 2016-06-29 16:56 Alexander Shiyan
  2016-06-29 16:56 ` [PATCH 2/2] ARM: i.MX clk-pllv1: " Alexander Shiyan
  2016-06-30  6:46 ` [PATCH 1/2] ARM: i.MX clk-pllv2: " Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2016-06-29 16:56 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-imx/clk-pllv2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/clk-pllv2.c b/arch/arm/mach-imx/clk-pllv2.c
index a2b016f..5ba07fa 100644
--- a/arch/arm/mach-imx/clk-pllv2.c
+++ b/arch/arm/mach-imx/clk-pllv2.c
@@ -113,8 +113,9 @@ static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate,
 	temp = (u64) ref_clk * mfn_abs;
 	do_div(temp, mfd + 1);
 	if (mfn < 0)
-		temp = -temp;
-	temp = (ref_clk * mfi) + temp;
+		temp = (ref_clk * mfi) - temp;
+	else
+		temp = (ref_clk * mfi) + temp;
 
 	return temp;
 }
-- 
2.4.9


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2016-06-30  6:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 16:56 [PATCH 1/2] ARM: i.MX clk-pllv2: Do not use a negative value for the unsigned variable Alexander Shiyan
2016-06-29 16:56 ` [PATCH 2/2] ARM: i.MX clk-pllv1: " Alexander Shiyan
2016-06-30  6:46 ` [PATCH 1/2] ARM: i.MX clk-pllv2: " Sascha Hauer

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