]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dmaengine: xgene-dma: use dma_pool_zalloc
authorVinod Koul <vinod.koul@intel.com>
Mon, 21 Sep 2015 15:26:58 +0000 (20:56 +0530)
committerVinod Koul <vinod.koul@intel.com>
Mon, 21 Sep 2015 15:26:58 +0000 (20:56 +0530)
We should use shiny new dma_pool_zalloc instead of
dma_pool_alloc/memset

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/xgene-dma.c

index b23e8d52d1263abc11cc126e9e0b80e1dcc5cc1b..dc84ed1f7541f312dc4b7ca83ceb56597ff097fa 100644 (file)
@@ -556,14 +556,12 @@ static struct xgene_dma_desc_sw *xgene_dma_alloc_descriptor(
        struct xgene_dma_desc_sw *desc;
        dma_addr_t phys;
 
-       desc = dma_pool_alloc(chan->desc_pool, GFP_NOWAIT, &phys);
+       desc = dma_pool_zalloc(chan->desc_pool, GFP_NOWAIT, &phys);
        if (!desc) {
                chan_err(chan, "Failed to allocate LDs\n");
                return NULL;
        }
 
-       memset(desc, 0, sizeof(*desc));
-
        INIT_LIST_HEAD(&desc->tx_list);
        desc->tx.phys = phys;
        desc->tx.tx_submit = xgene_dma_tx_submit;