usb : replace dma_pool_alloc and memset with dma_pool_zalloc
replace dma_pool_alloc and memset with a single call to dma_pool_zalloc Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
ced08b020e
commit
84c1eeb023
@@ -253,13 +253,12 @@ static struct gr_dma_desc *gr_alloc_dma_desc(struct gr_ep *ep, gfp_t gfp_flags)
|
||||
dma_addr_t paddr;
|
||||
struct gr_dma_desc *dma_desc;
|
||||
|
||||
dma_desc = dma_pool_alloc(ep->dev->desc_pool, gfp_flags, &paddr);
|
||||
dma_desc = dma_pool_zalloc(ep->dev->desc_pool, gfp_flags, &paddr);
|
||||
if (!dma_desc) {
|
||||
dev_err(ep->dev->dev, "Could not allocate from DMA pool\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(dma_desc, 0, sizeof(*dma_desc));
|
||||
dma_desc->paddr = paddr;
|
||||
|
||||
return dma_desc;
|
||||
|
Reference in New Issue
Block a user