linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ti/clkt_dpll: fix wrong do_div() usage
@ 2015-11-04  4:09 Nicolas Pitre
  2015-11-24  9:35 ` Tero Kristo
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pitre @ 2015-11-04  4:09 UTC (permalink / raw)
  To: Tero Kristo, Michael Turquette; +Cc: linux-omap, linux-clk

do_div() is meant to be used with an unsigned dividend.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c
index 9023ca9caf..b5cc6f66ae 100644
--- a/drivers/clk/ti/clkt_dpll.c
+++ b/drivers/clk/ti/clkt_dpll.c
@@ -240,7 +240,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw)
  */
 unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
 {
-	long long dpll_clk;
+	u64 dpll_clk;
 	u32 dpll_mult, dpll_div, v;
 	struct dpll_data *dd;
 
@@ -262,7 +262,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
 	dpll_div = v & dd->div1_mask;
 	dpll_div >>= __ffs(dd->div1_mask);
 
-	dpll_clk = (long long)clk_get_rate(dd->clk_ref) * dpll_mult;
+	dpll_clk = (u64)clk_get_rate(dd->clk_ref) * dpll_mult;
 	do_div(dpll_clk, dpll_div + 1);
 
 	return dpll_clk;

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

* Re: [PATCH] ti/clkt_dpll: fix wrong do_div() usage
  2015-11-04  4:09 [PATCH] ti/clkt_dpll: fix wrong do_div() usage Nicolas Pitre
@ 2015-11-24  9:35 ` Tero Kristo
  0 siblings, 0 replies; 2+ messages in thread
From: Tero Kristo @ 2015-11-24  9:35 UTC (permalink / raw)
  To: Nicolas Pitre, Michael Turquette; +Cc: linux-omap, linux-clk

On 11/04/2015 06:09 AM, Nicolas Pitre wrote:
> do_div() is meant to be used with an unsigned dividend.
>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>

Fixed Subject locally to format "clk: ti: %s".

Queued for 4.4-rc fixes, thanks.

-Tero

>
> diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c
> index 9023ca9caf..b5cc6f66ae 100644
> --- a/drivers/clk/ti/clkt_dpll.c
> +++ b/drivers/clk/ti/clkt_dpll.c
> @@ -240,7 +240,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw)
>    */
>   unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
>   {
> -	long long dpll_clk;
> +	u64 dpll_clk;
>   	u32 dpll_mult, dpll_div, v;
>   	struct dpll_data *dd;
>
> @@ -262,7 +262,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
>   	dpll_div = v & dd->div1_mask;
>   	dpll_div >>= __ffs(dd->div1_mask);
>
> -	dpll_clk = (long long)clk_get_rate(dd->clk_ref) * dpll_mult;
> +	dpll_clk = (u64)clk_get_rate(dd->clk_ref) * dpll_mult;
>   	do_div(dpll_clk, dpll_div + 1);
>
>   	return dpll_clk;
>


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

end of thread, other threads:[~2015-11-24  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04  4:09 [PATCH] ti/clkt_dpll: fix wrong do_div() usage Nicolas Pitre
2015-11-24  9:35 ` Tero Kristo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).