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
@@ -5362,8 +5362,8 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
|
||||
* mailbox command.
|
||||
*/
|
||||
dma_size = *vpd_size;
|
||||
dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev, dma_size,
|
||||
&dmabuf->phys, GFP_KERNEL);
|
||||
dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev, dma_size,
|
||||
&dmabuf->phys, GFP_KERNEL);
|
||||
if (!dmabuf->virt) {
|
||||
kfree(dmabuf);
|
||||
return -ENOMEM;
|
||||
@@ -6300,10 +6300,9 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
|
||||
dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
|
||||
LPFC_RAS_MAX_ENTRY_SIZE,
|
||||
&dmabuf->phys,
|
||||
GFP_KERNEL);
|
||||
&dmabuf->phys, GFP_KERNEL);
|
||||
if (!dmabuf->virt) {
|
||||
kfree(dmabuf);
|
||||
rc = -ENOMEM;
|
||||
@@ -14613,9 +14612,9 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t page_size,
|
||||
dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL);
|
||||
if (!dmabuf)
|
||||
goto out_fail;
|
||||
dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
|
||||
hw_page_size, &dmabuf->phys,
|
||||
GFP_KERNEL);
|
||||
dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
|
||||
hw_page_size, &dmabuf->phys,
|
||||
GFP_KERNEL);
|
||||
if (!dmabuf->virt) {
|
||||
kfree(dmabuf);
|
||||
goto out_fail;
|
||||
|
Reference in New Issue
Block a user