block: Use dma_zalloc_coherent
authorJoe Perches <joe@perches.com>
Sun, 15 Jun 2014 20:37:33 +0000 (13:37 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 4 Nov 2014 20:17:07 +0000 (13:17 -0700)
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nvme-core.c

index e2bb8af..baee595 100644 (file)
@@ -1275,11 +1275,10 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
        if (!nvmeq)
                return NULL;
 
-       nvmeq->cqes = dma_alloc_coherent(dmadev, CQ_SIZE(depth),
-                                       &nvmeq->cq_dma_addr, GFP_KERNEL);
+       nvmeq->cqes = dma_zalloc_coherent(dmadev, CQ_SIZE(depth),
+                                         &nvmeq->cq_dma_addr, GFP_KERNEL);
        if (!nvmeq->cqes)
                goto free_nvmeq;
-       memset((void *)nvmeq->cqes, 0, CQ_SIZE(depth));
 
        nvmeq->sq_cmds = dma_alloc_coherent(dmadev, SQ_SIZE(depth),
                                        &nvmeq->sq_dma_addr, GFP_KERNEL);