Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <j...@perches.com>
---
 drivers/block/nvme-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index a842c71..27b5d3b 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1242,11 +1242,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);
-- 
1.8.1.2.459.gbcd45b4.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to