Skip to content

Commit e20a471

Browse files
tititiou36kuba-moo
authored andcommitted
lan743x: 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 Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/ef548716606f257939df9738a801f15b6edf2568.1641743405.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cfcfc8f commit e20a471

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

drivers/net/ethernet/microchip/lan743x_main.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,13 +1739,10 @@ static int lan743x_tx_ring_init(struct lan743x_tx *tx)
17391739
}
17401740
if (dma_set_mask_and_coherent(&tx->adapter->pdev->dev,
17411741
DMA_BIT_MASK(64))) {
1742-
if (dma_set_mask_and_coherent(&tx->adapter->pdev->dev,
1743-
DMA_BIT_MASK(32))) {
1744-
dev_warn(&tx->adapter->pdev->dev,
1745-
"lan743x_: No suitable DMA available\n");
1746-
ret = -ENOMEM;
1747-
goto cleanup;
1748-
}
1742+
dev_warn(&tx->adapter->pdev->dev,
1743+
"lan743x_: No suitable DMA available\n");
1744+
ret = -ENOMEM;
1745+
goto cleanup;
17491746
}
17501747
ring_allocation_size = ALIGN(tx->ring_size *
17511748
sizeof(struct lan743x_tx_descriptor),
@@ -2284,13 +2281,10 @@ static int lan743x_rx_ring_init(struct lan743x_rx *rx)
22842281
}
22852282
if (dma_set_mask_and_coherent(&rx->adapter->pdev->dev,
22862283
DMA_BIT_MASK(64))) {
2287-
if (dma_set_mask_and_coherent(&rx->adapter->pdev->dev,
2288-
DMA_BIT_MASK(32))) {
2289-
dev_warn(&rx->adapter->pdev->dev,
2290-
"lan743x_: No suitable DMA available\n");
2291-
ret = -ENOMEM;
2292-
goto cleanup;
2293-
}
2284+
dev_warn(&rx->adapter->pdev->dev,
2285+
"lan743x_: No suitable DMA available\n");
2286+
ret = -ENOMEM;
2287+
goto cleanup;
22942288
}
22952289
ring_allocation_size = ALIGN(rx->ring_size *
22962290
sizeof(struct lan743x_rx_descriptor),

0 commit comments

Comments
 (0)