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

* [PATCH 2/2] ARM: i.MX clk-pllv1: Do not use a negative value for the unsigned variable
  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 ` Alexander Shiyan
  2016-06-30  6:46 ` [PATCH 1/2] ARM: i.MX clk-pllv2: " Sascha Hauer
  1 sibling, 0 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-pllv1.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
index 6785da0..f992134 100644
--- a/arch/arm/mach-imx/clk-pllv1.c
+++ b/arch/arm/mach-imx/clk-pllv1.c
@@ -61,8 +61,9 @@ static unsigned long clk_pllv1_recalc_rate(struct clk *clk,
 
 	do_div(ll, mfd + 1);
 	if (mfn < 0)
-		ll = -ll;
-	ll = (freq * mfi) + ll;
+		ll = (freq * mfi) - ll;
+	else
+		ll = (freq * mfi) + ll;
 
 	return ll;
 }
-- 
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

* Re: [PATCH 1/2] ARM: i.MX clk-pllv2: Do not use a negative value for the unsigned variable
  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 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2016-06-30  6:46 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Wed, Jun 29, 2016 at 07:56:48PM +0300, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/mach-imx/clk-pllv2.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> 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
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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