Skip to contentSkip to conversation

RDMA/pvrdma: Remove useless DMA-32 fallback configuration

PATCH Applied Christophe JAILLET 2 participants 2 messages Jan 9, 2022 – Jan 28, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/pvrdma: Remove useless DMA-32 fallback configuration

As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.

Simplify code and remove some dead code accordingly.

[1]: https://lkml.org/lkml/2021/6/7/398

---
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +4 -6
index 105f3a155939..343288b02792 100644
@@ -811,12 +811,10 @@ static int pvrdma_pci_probe(struct pci_dev *pdev,
 	}
 
 	/* Enable 64-Bit DMA */
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0) {
-		ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
-		if (ret != 0) {
-			dev_err(&pdev->dev, "dma_set_mask failed\n");
-			goto err_free_resource;
-		}
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret) {
+		dev_err(&pdev->dev, "dma_set_mask failed\n");
+		goto err_free_resource;
 	}
 	dma_set_max_seg_size(&pdev->dev, UINT_MAX);
 	pci_set_master(pdev);
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Christophe JAILLET

As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.

Quoted 8 lines

Simplify code and remove some dead code accordingly.

[1]: https://lkml.org/lkml/2021/6/7/398

---
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Applied to for-next, thanks

Jason