dmaengine: ste_dma40: Remove 'always true' checking
authorLee Jones <lee.jones@linaro.org>
Fri, 3 May 2013 14:32:04 +0000 (15:32 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 23 May 2013 19:12:51 +0000 (21:12 +0200)
Before allocating memory for logical channels, the current driver
checks to see if there are any. Well as the dma40_memcpy_channels[]
array is always populated, the check is always true. Best to
remove the check.

Cc: Dan Williams <djbw@fb.com>
Cc: Per Forlin <per.forlin@stericsson.com>
Cc: Rabin Vincent <rabin@rab.in>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/dma/ste_dma40.c

index f25c9ccf28e844be13c98125764cc86d1d15c9f4..7ccb8e2d59be1594cb2334036cfefd23c3734575 100644 (file)
@@ -3286,17 +3286,11 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev)
        if (!base->lookup_phy_chans)
                goto failure;
 
-       if (num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) {
-               /*
-                * The max number of logical channels are event lines for all
-                * src devices and dst devices
-                */
-               base->lookup_log_chans = kzalloc(num_log_chans *
-                                                sizeof(struct d40_chan *),
-                                                GFP_KERNEL);
-               if (!base->lookup_log_chans)
-                       goto failure;
-       }
+       base->lookup_log_chans = kzalloc(num_log_chans *
+                                        sizeof(struct d40_chan *),
+                                        GFP_KERNEL);
+       if (!base->lookup_log_chans)
+               goto failure;
 
        base->reg_val_backup_chan = kmalloc(base->num_phy_chans *
                                            sizeof(d40_backup_regs_chan),