ste_dma40: Move an assignment in d40_lcla_allocate()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 17 Sep 2016 06:24:46 +0000 (08:24 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 26 Sep 2016 17:36:16 +0000 (23:06 +0530)
Move one assignment for the local variable "ret" so that its setting
will only be performed after corresponding data processing succeeded
by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ste_dma40.c

index 6f198a31e619b097f0312d37788d72533dd47fcd..47acb61cb15a3b8466426aeb314664ad78baa87c 100644 (file)
@@ -3404,7 +3404,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
        struct d40_lcla_pool *pool = &base->lcla_pool;
        unsigned long *page_list;
        int i, j;
-       int ret = 0;
+       int ret;
 
        /*
         * This is somewhat ugly. We need 8192 bytes that are 18 bit aligned,
@@ -3476,6 +3476,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
 
        writel(virt_to_phys(base->lcla_pool.base),
               base->virtbase + D40_DREG_LCLA);
+       ret = 0;
  free_page_list:
        kfree(page_list);
        return ret;