lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220318005817.2141903-1-chi.minghao@zte.com.cn>
Date:   Fri, 18 Mar 2022 00:58:17 +0000
From:   cgel.zte@...il.com
To:     james.smart@...adcom.com
Cc:     dick.kennedy@...adcom.com, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] scsi: lpfc: Remove useless DMA-32 fallback configuration

From: Minghao Chi <chi.minghao@....com.cn>

As stated in [1], dma_set_mask() with a 64-bit mask will never fail 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

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
 drivers/scsi/lpfc/lpfc_init.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index f5c363f663f6..e793c4183499 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -9187,8 +9187,6 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *phba)
 
 	/* Set the device DMA mask size */
 	error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (error)
-		error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
 	if (error)
 		return error;
 	error = -ENODEV;
@@ -11714,8 +11712,6 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
 
 	/* Set the device DMA mask size */
 	error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (error)
-		error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
 	if (error)
 		return error;
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ