Skip to content

Commit 1aa7d97

Browse files
tititiou36martinkpetersen
authored andcommitted
scsi: efct: 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. While at it, return the error code returned by dma_set_mask_and_coherent() instead of -1. [1]: https://lkml.org/lkml/2021/6/7/398 Link: https://lore.kernel.org/r/958bcb2a6e86344c14f38369e8e7079615a2b0e3.1641754613.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 706dc3b commit 1aa7d97

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/scsi/elx/efct/efct_driver.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,10 @@ efct_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
541541

542542
pci_set_drvdata(pdev, efct);
543543

544-
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0) {
545-
dev_warn(&pdev->dev, "trying DMA_BIT_MASK(32)\n");
546-
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
547-
dev_err(&pdev->dev, "setting DMA_BIT_MASK failed\n");
548-
rc = -1;
549-
goto dma_mask_out;
550-
}
544+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
545+
if (rc) {
546+
dev_err(&pdev->dev, "setting DMA_BIT_MASK failed\n");
547+
goto dma_mask_out;
551548
}
552549

553550
num_interrupts = efct_device_interrupts_required(efct);

0 commit comments

Comments
 (0)