linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/hfi1: Remove useless DMA-32 fallback configuration
@ 2022-03-18  1:00 cgel.zte
  2022-03-18 16:22 ` Dennis Dalessandro
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-03-18  1:00 UTC (permalink / raw)
  To: mike.marciniszyn
  Cc: dennis.dalessandro, jgg, linux-rdma, linux-kernel, Minghao Chi,
	Zeal Robot

From: Minghao Chi <chi.minghao@zte.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@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/infiniband/hw/hfi1/pcie.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
index a0802332c8cb..b8394cd358a9 100644
--- a/drivers/infiniband/hw/hfi1/pcie.c
+++ b/drivers/infiniband/hw/hfi1/pcie.c
@@ -57,11 +57,8 @@ int hfi1_pcie_init(struct hfi1_devdata *dd)
 		 * do not setup 64 bit maps on systems with 2GB or less
 		 * memory installed.
 		 */
-		ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-		if (ret) {
 		dd_dev_err(dd, "Unable to set DMA mask: %d\n", ret);
 		goto bail;
-		}
 	}
 
 	pci_set_master(pdev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IB/hfi1: Remove useless DMA-32 fallback configuration
  2022-03-18  1:00 [PATCH] IB/hfi1: Remove useless DMA-32 fallback configuration cgel.zte
@ 2022-03-18 16:22 ` Dennis Dalessandro
  0 siblings, 0 replies; 2+ messages in thread
From: Dennis Dalessandro @ 2022-03-18 16:22 UTC (permalink / raw)
  To: cgel.zte; +Cc: jgg, linux-rdma, linux-kernel, Minghao Chi, Zeal Robot


On 3/17/22 9:00 PM, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.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@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/infiniband/hw/hfi1/pcie.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
> index a0802332c8cb..b8394cd358a9 100644
> --- a/drivers/infiniband/hw/hfi1/pcie.c
> +++ b/drivers/infiniband/hw/hfi1/pcie.c
> @@ -57,11 +57,8 @@ int hfi1_pcie_init(struct hfi1_devdata *dd)
>  		 * do not setup 64 bit maps on systems with 2GB or less
>  		 * memory installed.
>  		 */

Please remove the comment also since it no longer applies.

> -		ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> -		if (ret) {
>  		dd_dev_err(dd, "Unable to set DMA mask: %d\n", ret);
>  		goto bail;

Also then unindent these two lines.

> -		}
>  	}
>  
>  	pci_set_master(pdev);

-Denny

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-18 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18  1:00 [PATCH] IB/hfi1: Remove useless DMA-32 fallback configuration cgel.zte
2022-03-18 16:22 ` Dennis Dalessandro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).