Skip to content

Commit 0959a82

Browse files
tititiou36kuba-moo
authored andcommitted
net/qla3xxx: 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. So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1. 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/3011689e8c77d49d7e44509d5a8241320ec408c5.1641754134.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7ac2d77 commit 0959a82

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/net/ethernet/qlogic/qla3xxx.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,7 +3750,7 @@ static int ql3xxx_probe(struct pci_dev *pdev,
37503750
struct net_device *ndev = NULL;
37513751
struct ql3_adapter *qdev = NULL;
37523752
static int cards_found;
3753-
int pci_using_dac, err;
3753+
int err;
37543754

37553755
err = pci_enable_device(pdev);
37563756
if (err) {
@@ -3766,11 +3766,7 @@ static int ql3xxx_probe(struct pci_dev *pdev,
37663766

37673767
pci_set_master(pdev);
37683768

3769-
if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)))
3770-
pci_using_dac = 1;
3771-
else if (!(err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))))
3772-
pci_using_dac = 0;
3773-
3769+
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
37743770
if (err) {
37753771
pr_err("%s no usable DMA configuration\n", pci_name(pdev));
37763772
goto err_out_free_regions;
@@ -3797,8 +3793,7 @@ static int ql3xxx_probe(struct pci_dev *pdev,
37973793

37983794
qdev->msg_enable = netif_msg_init(debug, default_msg);
37993795

3800-
if (pci_using_dac)
3801-
ndev->features |= NETIF_F_HIGHDMA;
3796+
ndev->features |= NETIF_F_HIGHDMA;
38023797
if (qdev->device_id == QL3032_DEVICE_ID)
38033798
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
38043799

0 commit comments

Comments
 (0)