cross-tree: phase out dma_zalloc_coherent()

We already need to zero out memory for dma_alloc_coherent(), as such
using dma_zalloc_coherent() is superflous. Phase it out.

This change was generated with the following Coccinelle SmPL patch:

@ replace_dma_zalloc_coherent @
expression dev, size, data, handle, flags;
@@

-dma_zalloc_coherent(dev, size, handle, flags)
+dma_alloc_coherent(dev, size, handle, flags)

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
[hch: re-ran the script on the latest tree]
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Luis Chamberlain
2019-01-04 09:23:09 +01:00
committed by Christoph Hellwig
parent 3bd6e94bec
commit 750afb08ca
173 changed files with 915 additions and 949 deletions

View File

@@ -1394,10 +1394,9 @@ static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi)
{
struct qedi_nvm_iscsi_image nvm_image;
qedi->iscsi_image = dma_zalloc_coherent(&qedi->pdev->dev,
sizeof(nvm_image),
&qedi->nvm_buf_dma,
GFP_KERNEL);
qedi->iscsi_image = dma_alloc_coherent(&qedi->pdev->dev,
sizeof(nvm_image),
&qedi->nvm_buf_dma, GFP_KERNEL);
if (!qedi->iscsi_image) {
QEDI_ERR(&qedi->dbg_ctx, "Could not allocate NVM BUF.\n");
return -ENOMEM;
@@ -1510,10 +1509,10 @@ static int qedi_alloc_bdq(struct qedi_ctx *qedi)
}
/* Allocate list of PBL pages */
qedi->bdq_pbl_list = dma_zalloc_coherent(&qedi->pdev->dev,
QEDI_PAGE_SIZE,
&qedi->bdq_pbl_list_dma,
GFP_KERNEL);
qedi->bdq_pbl_list = dma_alloc_coherent(&qedi->pdev->dev,
QEDI_PAGE_SIZE,
&qedi->bdq_pbl_list_dma,
GFP_KERNEL);
if (!qedi->bdq_pbl_list) {
QEDI_ERR(&qedi->dbg_ctx,
"Could not allocate list of PBL pages.\n");
@@ -1609,10 +1608,10 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
(qedi->global_queues[i]->cq_pbl_size +
(QEDI_PAGE_SIZE - 1));
qedi->global_queues[i]->cq = dma_zalloc_coherent(&qedi->pdev->dev,
qedi->global_queues[i]->cq_mem_size,
&qedi->global_queues[i]->cq_dma,
GFP_KERNEL);
qedi->global_queues[i]->cq = dma_alloc_coherent(&qedi->pdev->dev,
qedi->global_queues[i]->cq_mem_size,
&qedi->global_queues[i]->cq_dma,
GFP_KERNEL);
if (!qedi->global_queues[i]->cq) {
QEDI_WARN(&qedi->dbg_ctx,
@@ -1620,10 +1619,10 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
status = -ENOMEM;
goto mem_alloc_failure;
}
qedi->global_queues[i]->cq_pbl = dma_zalloc_coherent(&qedi->pdev->dev,
qedi->global_queues[i]->cq_pbl_size,
&qedi->global_queues[i]->cq_pbl_dma,
GFP_KERNEL);
qedi->global_queues[i]->cq_pbl = dma_alloc_coherent(&qedi->pdev->dev,
qedi->global_queues[i]->cq_pbl_size,
&qedi->global_queues[i]->cq_pbl_dma,
GFP_KERNEL);
if (!qedi->global_queues[i]->cq_pbl) {
QEDI_WARN(&qedi->dbg_ctx,
@@ -1691,16 +1690,16 @@ int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep)
ep->sq_pbl_size = (ep->sq_mem_size / QEDI_PAGE_SIZE) * sizeof(void *);
ep->sq_pbl_size = ep->sq_pbl_size + QEDI_PAGE_SIZE;
ep->sq = dma_zalloc_coherent(&qedi->pdev->dev, ep->sq_mem_size,
&ep->sq_dma, GFP_KERNEL);
ep->sq = dma_alloc_coherent(&qedi->pdev->dev, ep->sq_mem_size,
&ep->sq_dma, GFP_KERNEL);
if (!ep->sq) {
QEDI_WARN(&qedi->dbg_ctx,
"Could not allocate send queue.\n");
rval = -ENOMEM;
goto out;
}
ep->sq_pbl = dma_zalloc_coherent(&qedi->pdev->dev, ep->sq_pbl_size,
&ep->sq_pbl_dma, GFP_KERNEL);
ep->sq_pbl = dma_alloc_coherent(&qedi->pdev->dev, ep->sq_pbl_size,
&ep->sq_pbl_dma, GFP_KERNEL);
if (!ep->sq_pbl) {
QEDI_WARN(&qedi->dbg_ctx,
"Could not allocate send queue PBL.\n");