linux/drivers/infiniband/hw/usnic
Christophe JAILLET 3e9fed7fb6 RDMA/usnic: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script bellow.
It has been compile tested.

When memory is allocated, GFP_ATOMIC should be used to be consistent with
the surrounding code.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Link: https://lore.kernel.org/r/20200711073120.249146-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-07-16 15:42:05 -03:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile infiniband: prefix header search paths with $(srctree)/ 2019-01-25 15:28:50 -07:00
usnic.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_abi.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_common_pkt_hdr.h RDMA: Adding ethertype ETH_P_IBOE 2017-01-10 14:05:11 -05:00
usnic_common_util.h {net,IB}/{rxe,usnic}: Utilize generic mac to eui32 function 2017-04-25 14:21:34 -04:00
usnic_debugfs.c infiniband: usnic: no need to check return value of debugfs_create functions 2019-01-24 09:22:30 -07:00
usnic_debugfs.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_fwd.c RDMA/usnic: switch from 'pci_' to 'dma_' API 2020-07-16 15:42:05 -03:00
usnic_fwd.h RDMA/usnic: Suppress a compiler warning 2018-07-26 11:39:06 -06:00
usnic_ib.h RDMA: Convert CQ allocations to be under core responsibility 2019-06-11 16:39:49 -04:00
usnic_ib_main.c RDMA/usnic: Avoid overly large buffers on stack 2019-09-13 16:55:55 -03:00
usnic_ib_qp_grp.c IB/usnic: fix spelling mistake "miniumum" -> "minimum" 2018-11-29 15:59:40 -07:00
usnic_ib_qp_grp.h RDMA/usnic: Instantiate data structures once 2017-10-14 20:47:07 -04:00
usnic_ib_sysfs.c RDMA: Introduce and use rdma_device_to_ibdev() 2019-01-14 13:12:03 -07:00
usnic_ib_sysfs.h RDMA/drivers: Use core provided API for registering device attributes 2018-10-17 03:45:01 -06:00
usnic_ib_verbs.c RDMA: Remove 'max_map_per_fmr' 2020-06-02 20:32:54 -03:00
usnic_ib_verbs.h RDMA: Convert CQ allocations to be under core responsibility 2019-06-11 16:39:49 -04:00
usnic_log.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_transport.c IB/usnic: fix spelling mistake "unvalid" -> "invalid" 2018-09-25 14:35:06 -06:00
usnic_transport.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_uiom.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
usnic_uiom.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
usnic_uiom_interval_tree.c lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
usnic_uiom_interval_tree.h lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
usnic_vnic.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
usnic_vnic.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00