[PATCH] PCI: vmd: Remove useless DMA-32 fallback configuration

From: Christophe JAILLET
Date: Sat Jan 15 2022 - 10:20:50 EST


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://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@xxxxxxxxxxxxx/#t

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
drivers/pci/controller/vmd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index cc166c683638..dead82b23a98 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -914,8 +914,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
}

pci_set_master(dev);
- if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) &&
- dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
+ if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64))) {
err = -ENODEV;
goto out_release_instance;
}
--
2.32.0