lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scsi: ipr: Remove useless DMA-32 fallback configuration
Date
From: Minghao Chi <chi.minghao@zte.com.cn>

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

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

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 104bee9b3a9d..dd8b32b00c9b 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -10261,11 +10261,8 @@ static int ipr_probe_ioa(struct pci_dev *pdev,

if (ioa_cfg->sis64) {
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (rc < 0) {
+ if (rc < 0)
dev_dbg(&pdev->dev, "Failed to set 64 bit DMA mask\n");
- rc = dma_set_mask_and_coherent(&pdev->dev,
- DMA_BIT_MASK(32));
- }
} else
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));

--
2.25.1
\
 
 \ /
  Last update: 2022-03-18 02:01    [W:0.035 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site