mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 01:24:33 +00:00
IB/ipath: Remove ib_sg_dma_address() and ib_sg_dma_len() overloads
The removal of these methods is compensated for by code changes to .map_sg to insure that the vanilla sg_dma_address() and sg_dma_len() will do the same thing as the equivalent former ib_sg_dma_address() and ib_sg_dma_len() calls into the drivers. The introduction of this patch required that the struct ipath_dma_mapping_ops be converted to a C99 initializer. Suggested-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
446bf432a9
commit
49c5c27e05
@ -115,6 +115,10 @@ static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sgl,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
sg->dma_address = addr + sg->offset;
|
||||||
|
#ifdef CONFIG_NEED_SG_DMA_LENGTH
|
||||||
|
sg->dma_length = sg->length;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -126,21 +130,6 @@ static void ipath_unmap_sg(struct ib_device *dev,
|
|||||||
BUG_ON(!valid_dma_direction(direction));
|
BUG_ON(!valid_dma_direction(direction));
|
||||||
}
|
}
|
||||||
|
|
||||||
static u64 ipath_sg_dma_address(struct ib_device *dev, struct scatterlist *sg)
|
|
||||||
{
|
|
||||||
u64 addr = (u64) page_address(sg_page(sg));
|
|
||||||
|
|
||||||
if (addr)
|
|
||||||
addr += sg->offset;
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int ipath_sg_dma_len(struct ib_device *dev,
|
|
||||||
struct scatterlist *sg)
|
|
||||||
{
|
|
||||||
return sg->length;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ipath_sync_single_for_cpu(struct ib_device *dev,
|
static void ipath_sync_single_for_cpu(struct ib_device *dev,
|
||||||
u64 addr,
|
u64 addr,
|
||||||
size_t size,
|
size_t size,
|
||||||
@ -176,17 +165,15 @@ static void ipath_dma_free_coherent(struct ib_device *dev, size_t size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ib_dma_mapping_ops ipath_dma_mapping_ops = {
|
struct ib_dma_mapping_ops ipath_dma_mapping_ops = {
|
||||||
ipath_mapping_error,
|
.mapping_error = ipath_mapping_error,
|
||||||
ipath_dma_map_single,
|
.map_single = ipath_dma_map_single,
|
||||||
ipath_dma_unmap_single,
|
.unmap_single = ipath_dma_unmap_single,
|
||||||
ipath_dma_map_page,
|
.map_page = ipath_dma_map_page,
|
||||||
ipath_dma_unmap_page,
|
.unmap_page = ipath_dma_unmap_page,
|
||||||
ipath_map_sg,
|
.map_sg = ipath_map_sg,
|
||||||
ipath_unmap_sg,
|
.unmap_sg = ipath_unmap_sg,
|
||||||
ipath_sg_dma_address,
|
.sync_single_for_cpu = ipath_sync_single_for_cpu,
|
||||||
ipath_sg_dma_len,
|
.sync_single_for_device = ipath_sync_single_for_device,
|
||||||
ipath_sync_single_for_cpu,
|
.alloc_coherent = ipath_dma_alloc_coherent,
|
||||||
ipath_sync_single_for_device,
|
.free_coherent = ipath_dma_free_coherent
|
||||||
ipath_dma_alloc_coherent,
|
|
||||||
ipath_dma_free_coherent
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user