dmaengine: edma: Use devm_kcalloc when possible

When allocating a memory for number of items it is better (looks better)
to use devm_kcalloc.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
Peter Ujfalusi 2015-10-14 14:42:55 +03:00 committed by Vinod Koul
parent cb78205955
commit 547c6e2711
1 changed files with 2 additions and 2 deletions

View File

@ -2055,7 +2055,7 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
* priority. So Q0 is the highest priority queue and the last queue has * priority. So Q0 is the highest priority queue and the last queue has
* the lowest priority. * the lowest priority.
*/ */
queue_priority_map = devm_kzalloc(dev, (ecc->num_tc + 1) * sizeof(s8), queue_priority_map = devm_kcalloc(dev, ecc->num_tc + 1, sizeof(s8),
GFP_KERNEL); GFP_KERNEL);
if (!queue_priority_map) if (!queue_priority_map)
return -ENOMEM; return -ENOMEM;
@ -2086,7 +2086,7 @@ static int edma_xbar_event_map(struct device *dev, struct edma_soc_info *pdata,
u32 shift, offset, mux; u32 shift, offset, mux;
int ret, i; int ret, i;
xbar_chans = devm_kzalloc(dev, (nelm + 2) * sizeof(s16), GFP_KERNEL); xbar_chans = devm_kcalloc(dev, nelm + 2, sizeof(s16), GFP_KERNEL);
if (!xbar_chans) if (!xbar_chans)
return -ENOMEM; return -ENOMEM;