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
@@ -89,8 +89,8 @@ static int register_sba(struct ism_dev *ism)
|
||||
dma_addr_t dma_handle;
|
||||
struct ism_sba *sba;
|
||||
|
||||
sba = dma_zalloc_coherent(&ism->pdev->dev, PAGE_SIZE,
|
||||
&dma_handle, GFP_KERNEL);
|
||||
sba = dma_alloc_coherent(&ism->pdev->dev, PAGE_SIZE, &dma_handle,
|
||||
GFP_KERNEL);
|
||||
if (!sba)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -116,8 +116,8 @@ static int register_ieq(struct ism_dev *ism)
|
||||
dma_addr_t dma_handle;
|
||||
struct ism_eq *ieq;
|
||||
|
||||
ieq = dma_zalloc_coherent(&ism->pdev->dev, PAGE_SIZE,
|
||||
&dma_handle, GFP_KERNEL);
|
||||
ieq = dma_alloc_coherent(&ism->pdev->dev, PAGE_SIZE, &dma_handle,
|
||||
GFP_KERNEL);
|
||||
if (!ieq)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -234,10 +234,9 @@ static int ism_alloc_dmb(struct ism_dev *ism, struct smcd_dmb *dmb)
|
||||
test_and_set_bit(dmb->sba_idx, ism->sba_bitmap))
|
||||
return -EINVAL;
|
||||
|
||||
dmb->cpu_addr = dma_zalloc_coherent(&ism->pdev->dev, dmb->dmb_len,
|
||||
&dmb->dma_addr, GFP_KERNEL |
|
||||
__GFP_NOWARN | __GFP_NOMEMALLOC |
|
||||
__GFP_COMP | __GFP_NORETRY);
|
||||
dmb->cpu_addr = dma_alloc_coherent(&ism->pdev->dev, dmb->dmb_len,
|
||||
&dmb->dma_addr,
|
||||
GFP_KERNEL | __GFP_NOWARN | __GFP_NOMEMALLOC | __GFP_COMP | __GFP_NORETRY);
|
||||
if (!dmb->cpu_addr)
|
||||
clear_bit(dmb->sba_idx, ism->sba_bitmap);
|
||||
|
||||
|
Reference in New Issue
Block a user