Skip to content

Commit

Permalink
IB/core: Remove overload in ib_sg_dma*
Browse files Browse the repository at this point in the history
The code is replaced by driver specific changes and avoids the pointer
NULL test for drivers that don't overload these operations.

Suggested-by: <Bart Van Assche <[email protected]>
Reviewed-by: Dennis Dalessandro <[email protected]>
Tested-by: Vinod Kumar <[email protected]>
Signed-off-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
mmarcini authored and rolandd committed Apr 1, 2014
1 parent f3585a6 commit ea58a59
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1266,10 +1266,6 @@ struct ib_dma_mapping_ops {
void (*unmap_sg)(struct ib_device *dev,
struct scatterlist *sg, int nents,
enum dma_data_direction direction);
u64 (*dma_address)(struct ib_device *dev,
struct scatterlist *sg);
unsigned int (*dma_len)(struct ib_device *dev,
struct scatterlist *sg);
void (*sync_single_for_cpu)(struct ib_device *dev,
u64 dma_handle,
size_t size,
Expand Down Expand Up @@ -2089,25 +2085,27 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
* ib_sg_dma_address - Return the DMA address from a scatter/gather entry
* @dev: The device for which the DMA addresses were created
* @sg: The scatter/gather entry
*
* Note: this function is obsolete. To do: change all occurrences of
* ib_sg_dma_address() into sg_dma_address().
*/
static inline u64 ib_sg_dma_address(struct ib_device *dev,
struct scatterlist *sg)
{
if (dev->dma_ops)
return dev->dma_ops->dma_address(dev, sg);
return sg_dma_address(sg);
}

/**
* ib_sg_dma_len - Return the DMA length from a scatter/gather entry
* @dev: The device for which the DMA addresses were created
* @sg: The scatter/gather entry
*
* Note: this function is obsolete. To do: change all occurrences of
* ib_sg_dma_len() into sg_dma_len().
*/
static inline unsigned int ib_sg_dma_len(struct ib_device *dev,
struct scatterlist *sg)
{
if (dev->dma_ops)
return dev->dma_ops->dma_len(dev, sg);
return sg_dma_len(sg);
}

Expand Down

0 comments on commit ea58a59

Please sign in to comment.