diff options
author | Joe Perches <joe@perches.com> | 2014-06-15 13:37:33 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-04 13:17:07 -0700 |
commit | 4d51abf9bcca01efa3afbe94d50cc2cda8095da8 (patch) | |
tree | e0f02d9b511ab2a13089ed79297a12fe2b4f903c /drivers/block/nvme-core.c | |
parent | e167dfb53cb85fde7b15f644e9dbef7ba31896b6 (diff) | |
download | lwn-4d51abf9bcca01efa3afbe94d50cc2cda8095da8.tar.gz lwn-4d51abf9bcca01efa3afbe94d50cc2cda8095da8.zip |
block: Use dma_zalloc_coherent
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>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r-- | drivers/block/nvme-core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index e2bb8afbeae5..baee59530d6e 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -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); |