[PATCH 2/2] RDMA: dma-mapping: Return an unsigned int from ib_dma_map_sg{,_attrs}

Jack Wang
2022-08-26T09:56:31Z

Following 2a047e0662ae ("dma-mapping: return an unsigned int from dma_map_sg{,_attrs}")
change the return value of ib_dma_map_sg{,attrs} to unsigned int.

Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
drivers/infiniband/core/device.c | 2 +-
include/rdma/ib_verbs.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index d275db195f1a..72489294391d 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -2721,7 +2721,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
EXPORT_SYMBOL(ib_set_device_ops);

#ifdef CONFIG_INFINIBAND_VIRT_DMA
-int ib_dma_virt_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents)
+unsigned int ib_dma_virt_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents)
{
struct scatterlist *s;
int i;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 975d6e9efbcb..49256bf8cbf5 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4101,8 +4101,8 @@ static inline void ib_dma_unmap_page(struct ib_device *dev,
dma_unmap_page(dev->dma_device, addr, size, direction);
}

-int ib_dma_virt_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents);
-static inline int ib_dma_map_sg_attrs(struct ib_device *dev,
+unsigned int ib_dma_virt_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents);
+static inline unsigned int ib_dma_map_sg_attrs(struct ib_device *dev,
struct scatterlist *sg, int nents,
enum dma_data_direction direction,
unsigned long dma_attrs)
@@ -4163,7 +4163,7 @@ static inline void ib_dma_unmap_sgtable_attrs(struct ib_device *dev,
* @nents: The number of scatter/gather entries
* @direction: The direction of the DMA
*/
-static inline int ib_dma_map_sg(struct ib_device *dev,
+static inline unsigned int ib_dma_map_sg(struct ib_device *dev,
struct scatterlist *sg, int nents,
enum dma_data_direction direction)
{
--
2.34.1