lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 38/94] ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow
    Date
    From: Tero Kristo <t-kristo@ti.com>

    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>
    Signed-off-by: sam-the-6 <asadi.samuel@gmail.com>
    ---
    arch/arm/mach-omap2/clkt_dpll.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
    index 332af92..67fd26a 100644
    --- a/arch/arm/mach-omap2/clkt_dpll.c
    +++ b/arch/arm/mach-omap2/clkt_dpll.c
    @@ -76,7 +76,7 @@
    * (assuming that it is counting N upwards), or -2 if the enclosing loop
    * should skip to the next iteration (again assuming N is increasing).
    */
    -static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n)
    +static int _dpll_test_fint(struct clk_hw_omap *clk, unsigned int n)
    {
    struct dpll_data *dd;
    long fint, fint_min, fint_max;
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2014-07-18 08:41    [W:2.997 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site