diff options
author | Tero Kristo <t-kristo@ti.com> | 2014-07-02 04:47:35 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2014-07-06 17:58:38 -0400 |
commit | 6340c8720ce34f35b41a2e15d69fe3d755cb2104 (patch) | |
tree | 21536371ee55e3a894bc0f8849b4550077a47252 | |
parent | d904b38df0db137dc5f562010231f76c443cbe28 (diff) |
ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow
The divider value provided to the _dpll_test_fint can reach value of
256 with J type DPLLs (USB etc.), which causes an overflow with the u8
datatype. Fix this by changing the parameter to be an int instead.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
[paul@pwsan.com: changed type of 'n' to unsigned int]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/clkt_dpll.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 332af927f4d3..67fd26a18441 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -76,7 +76,7 @@ | |||
76 | * (assuming that it is counting N upwards), or -2 if the enclosing loop | 76 | * (assuming that it is counting N upwards), or -2 if the enclosing loop |
77 | * should skip to the next iteration (again assuming N is increasing). | 77 | * should skip to the next iteration (again assuming N is increasing). |
78 | */ | 78 | */ |
79 | static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n) | 79 | static int _dpll_test_fint(struct clk_hw_omap *clk, unsigned int n) |
80 | { | 80 | { |
81 | struct dpll_data *dd; | 81 | struct dpll_data *dd; |
82 | long fint, fint_min, fint_max; | 82 | long fint, fint_min, fint_max; |