Message ID | f10bb9f76b275a74b4efd7661bf9499a8b72eaa2.1642259917.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Lorenzo Pieralisi |
Headers | show |
Series | PCI: vmd: Remove useless DMA-32 fallback configuration | expand |
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; }
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@infradead.org/#t Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/pci/controller/vmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)