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:

committed by
Christoph Hellwig

parent
3bd6e94bec
commit
750afb08ca
@@ -711,30 +711,24 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,
|
||||
* Allocate the circular buffer of Read Buffer Descriptors
|
||||
* (RBDs)
|
||||
*/
|
||||
rxq->bd = dma_zalloc_coherent(dev,
|
||||
free_size * rxq->queue_size,
|
||||
&rxq->bd_dma, GFP_KERNEL);
|
||||
rxq->bd = dma_alloc_coherent(dev, free_size * rxq->queue_size,
|
||||
&rxq->bd_dma, GFP_KERNEL);
|
||||
if (!rxq->bd)
|
||||
goto err;
|
||||
|
||||
if (trans->cfg->mq_rx_supported) {
|
||||
rxq->used_bd = dma_zalloc_coherent(dev,
|
||||
(use_rx_td ?
|
||||
sizeof(*rxq->cd) :
|
||||
sizeof(__le32)) *
|
||||
rxq->queue_size,
|
||||
&rxq->used_bd_dma,
|
||||
GFP_KERNEL);
|
||||
rxq->used_bd = dma_alloc_coherent(dev,
|
||||
(use_rx_td ? sizeof(*rxq->cd) : sizeof(__le32)) * rxq->queue_size,
|
||||
&rxq->used_bd_dma,
|
||||
GFP_KERNEL);
|
||||
if (!rxq->used_bd)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Allocate the driver's pointer to receive buffer status */
|
||||
rxq->rb_stts = dma_zalloc_coherent(dev, use_rx_td ?
|
||||
sizeof(__le16) :
|
||||
sizeof(struct iwl_rb_status),
|
||||
&rxq->rb_stts_dma,
|
||||
GFP_KERNEL);
|
||||
rxq->rb_stts = dma_alloc_coherent(dev,
|
||||
use_rx_td ? sizeof(__le16) : sizeof(struct iwl_rb_status),
|
||||
&rxq->rb_stts_dma, GFP_KERNEL);
|
||||
if (!rxq->rb_stts)
|
||||
goto err;
|
||||
|
||||
@@ -742,16 +736,14 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,
|
||||
return 0;
|
||||
|
||||
/* Allocate the driver's pointer to TR tail */
|
||||
rxq->tr_tail = dma_zalloc_coherent(dev, sizeof(__le16),
|
||||
&rxq->tr_tail_dma,
|
||||
GFP_KERNEL);
|
||||
rxq->tr_tail = dma_alloc_coherent(dev, sizeof(__le16),
|
||||
&rxq->tr_tail_dma, GFP_KERNEL);
|
||||
if (!rxq->tr_tail)
|
||||
goto err;
|
||||
|
||||
/* Allocate the driver's pointer to CR tail */
|
||||
rxq->cr_tail = dma_zalloc_coherent(dev, sizeof(__le16),
|
||||
&rxq->cr_tail_dma,
|
||||
GFP_KERNEL);
|
||||
rxq->cr_tail = dma_alloc_coherent(dev, sizeof(__le16),
|
||||
&rxq->cr_tail_dma, GFP_KERNEL);
|
||||
if (!rxq->cr_tail)
|
||||
goto err;
|
||||
/*
|
||||
@@ -1947,9 +1939,8 @@ int iwl_pcie_alloc_ict(struct iwl_trans *trans)
|
||||
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
||||
|
||||
trans_pcie->ict_tbl =
|
||||
dma_zalloc_coherent(trans->dev, ICT_SIZE,
|
||||
&trans_pcie->ict_tbl_dma,
|
||||
GFP_KERNEL);
|
||||
dma_alloc_coherent(trans->dev, ICT_SIZE,
|
||||
&trans_pcie->ict_tbl_dma, GFP_KERNEL);
|
||||
if (!trans_pcie->ict_tbl)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Reference in New Issue
Block a user