]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
dmaengine: vdma: Use dma_pool_zalloc
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Wed, 13 Jul 2016 09:20:22 +0000 (14:50 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 14 Jul 2016 06:13:05 +0000 (08:13 +0200)
dma_pool_zalloc combines dma_pool_alloc and memset 0
this patch updates the driver to use dma_pool_zalloc.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/xilinx/xilinx_vdma.c

index 3edd4544478a489c92bd79c8abfd39d6922e4f10..0f5b38a0e46f4f5e7e18fe34eabe289f4b87fdca 100644 (file)
@@ -498,11 +498,10 @@ xilinx_cdma_alloc_tx_segment(struct xilinx_dma_chan *chan)
        struct xilinx_cdma_tx_segment *segment;
        dma_addr_t phys;
 
-       segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys);
+       segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys);
        if (!segment)
                return NULL;
 
-       memset(segment, 0, sizeof(*segment));
        segment->phys = phys;
 
        return segment;
@@ -520,11 +519,10 @@ xilinx_axidma_alloc_tx_segment(struct xilinx_dma_chan *chan)
        struct xilinx_axidma_tx_segment *segment;
        dma_addr_t phys;
 
-       segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys);
+       segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys);
        if (!segment)
                return NULL;
 
-       memset(segment, 0, sizeof(*segment));
        segment->phys = phys;
 
        return segment;