lkml.org 
[lkml]   [2020]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/4] RDMA/efa : Remove pci-dma-compat wrapper APIs
From
Date
On Sun, 2020-08-09 at 13:15 +0530, Suraj Upadhyay wrote:
> The legacy API wrappers in include/linux/pci-dma-compat.h
> should go away as it creates unnecessary midlayering
> for include/linux/dma-mapping.h APIs.
>
> Instead use dma-mapping.h APIs directly.
>
> The patch has been generated with the coccinelle script below
> and compile-tested.
[]
> diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
[]
> @@ -405,13 +405,13 @@ static int efa_device_init(struct efa_com_dev *edev, struct pci_dev *pdev)
> return err;
> }
>
> - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_width));
> + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_width));
> if (err) {
> dev_err(&pdev->dev, "pci_set_dma_mask failed %d\n", err);

Coccinelle is great for some things, but not
necessarily for these sorts of changes in an
completely automated way.

The dev_err messages also need to be changed
as the format string contains the old name.

> - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(dma_width));
> + err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(dma_width));
> if (err) {
> dev_err(&pdev->dev,
> "err_pci_set_consistent_dma_mask failed %d\n",



\
 
 \ /
  Last update: 2020-08-09 10:12    [W:0.056 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site