From: Lee Jones Date: Fri, 3 May 2013 14:32:04 +0000 (+0100) Subject: dmaengine: ste_dma40: Remove 'always true' checking X-Git-Tag: upstream/snapshot3+hdmi~4839^2~17^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a59fed39577d7313921a59dba8cc1711ae90da5;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git dmaengine: ste_dma40: Remove 'always true' checking 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 Cc: Per Forlin Cc: Rabin Vincent Acked-by: Vinod Koul Acked-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index f25c9cc..7ccb8e2 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -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),