aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2020-07-08 09:30:00 +0200
committerChristoph Hellwig <[email protected]>2020-07-19 09:29:23 +0200
commit2f9237d4f6df49b74c51cdac555b0a9979d0c237 (patch)
tree6a09811a657e87bc6b716443993bceb2775a1b8f /drivers/infiniband/core
parentdma-mapping: inline the fast path dma-direct calls (diff)
downloadwireguard-linux-2f9237d4f6df49b74c51cdac555b0a9979d0c237.tar.xz
wireguard-linux-2f9237d4f6df49b74c51cdac555b0a9979d0c237.zip
dma-mapping: make support for dma ops optional
Avoid the overhead of the dma ops support for tiny builds that only use the direct mapping. Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Alexey Kardashevskiy <[email protected]> Reviewed-by: Alexey Kardashevskiy <[email protected]>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 905a2beaf885..2927a9d16eaa 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -1183,6 +1183,8 @@ static void setup_dma_device(struct ib_device *device)
struct device *parent = device->dev.parent;
WARN_ON_ONCE(device->dma_device);
+
+#ifdef CONFIG_DMA_OPS
if (device->dev.dma_ops) {
/*
* The caller provided custom DMA operations. Copy the
@@ -1203,7 +1205,9 @@ static void setup_dma_device(struct ib_device *device)
else
WARN_ON_ONCE(true);
}
- } else {
+ } else
+#endif /* CONFIG_DMA_OPS */
+ {
/*
* The caller did not provide custom DMA operations. Use the
* DMA mapping operations of the parent device.
OSZAR »