diff options
| author | Luis Chamberlain <mcgrof@kernel.org> | 2019-01-04 03:23:09 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2019-01-08 07:58:37 -0500 |
| commit | 750afb08ca71310fcf0c4e2cb1565c63b8235b60 (patch) | |
| tree | 1dde3877eb4a1a0f0349786b66c3d9276ae94561 /drivers/infiniband/hw/hfi1/sdma.c | |
| parent | 3bd6e94bec122a951d462c239b47954cf5f36e33 (diff) | |
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>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/sdma.c')
| -rw-r--r-- | drivers/infiniband/hw/hfi1/sdma.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index b84356e1a4c1..96897a91fb0a 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c | |||
| @@ -1453,12 +1453,9 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) | |||
| 1453 | timer_setup(&sde->err_progress_check_timer, | 1453 | timer_setup(&sde->err_progress_check_timer, |
| 1454 | sdma_err_progress_check, 0); | 1454 | sdma_err_progress_check, 0); |
| 1455 | 1455 | ||
| 1456 | sde->descq = dma_zalloc_coherent( | 1456 | sde->descq = dma_alloc_coherent(&dd->pcidev->dev, |
| 1457 | &dd->pcidev->dev, | 1457 | descq_cnt * sizeof(u64[2]), |
| 1458 | descq_cnt * sizeof(u64[2]), | 1458 | &sde->descq_phys, GFP_KERNEL); |
| 1459 | &sde->descq_phys, | ||
| 1460 | GFP_KERNEL | ||
| 1461 | ); | ||
| 1462 | if (!sde->descq) | 1459 | if (!sde->descq) |
| 1463 | goto bail; | 1460 | goto bail; |
| 1464 | sde->tx_ring = | 1461 | sde->tx_ring = |
| @@ -1471,24 +1468,18 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) | |||
| 1471 | 1468 | ||
| 1472 | dd->sdma_heads_size = L1_CACHE_BYTES * num_engines; | 1469 | dd->sdma_heads_size = L1_CACHE_BYTES * num_engines; |
| 1473 | /* Allocate memory for DMA of head registers to memory */ | 1470 | /* Allocate memory for DMA of head registers to memory */ |
| 1474 | dd->sdma_heads_dma = dma_zalloc_coherent( | 1471 | dd->sdma_heads_dma = dma_alloc_coherent(&dd->pcidev->dev, |
| 1475 | &dd->pcidev->dev, | 1472 | dd->sdma_heads_size, |
| 1476 | dd->sdma_heads_size, | 1473 | &dd->sdma_heads_phys, |
| 1477 | &dd->sdma_heads_phys, | 1474 | GFP_KERNEL); |
| 1478 | GFP_KERNEL | ||
| 1479 | ); | ||
| 1480 | if (!dd->sdma_heads_dma) { | 1475 | if (!dd->sdma_heads_dma) { |
| 1481 | dd_dev_err(dd, "failed to allocate SendDMA head memory\n"); | 1476 | dd_dev_err(dd, "failed to allocate SendDMA head memory\n"); |
| 1482 | goto bail; | 1477 | goto bail; |
| 1483 | } | 1478 | } |
| 1484 | 1479 | ||
| 1485 | /* Allocate memory for pad */ | 1480 | /* Allocate memory for pad */ |
| 1486 | dd->sdma_pad_dma = dma_zalloc_coherent( | 1481 | dd->sdma_pad_dma = dma_alloc_coherent(&dd->pcidev->dev, sizeof(u32), |
| 1487 | &dd->pcidev->dev, | 1482 | &dd->sdma_pad_phys, GFP_KERNEL); |
| 1488 | sizeof(u32), | ||
| 1489 | &dd->sdma_pad_phys, | ||
| 1490 | GFP_KERNEL | ||
| 1491 | ); | ||
| 1492 | if (!dd->sdma_pad_dma) { | 1483 | if (!dd->sdma_pad_dma) { |
| 1493 | dd_dev_err(dd, "failed to allocate SendDMA pad memory\n"); | 1484 | dd_dev_err(dd, "failed to allocate SendDMA pad memory\n"); |
| 1494 | goto bail; | 1485 | goto bail; |
