IB/core: Remove overload in ib_sg_dma*
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 28 Mar 2014 17:26:59 +0000 (13:26 -0400)
committerRoland Dreier <roland@purestorage.com>
Tue, 1 Apr 2014 18:16:32 +0000 (11:16 -0700)
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 <bvanassche@acm.org>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Tested-by: Vinod Kumar <vinod.kumar@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
include/rdma/ib_verbs.h

index 6793f32ccb581f4313d052d7a228a0e7852e0973..57777167dea7854453dbc05c12b33286c99b0ce2 100644 (file)
@@ -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);
        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,
        void            (*sync_single_for_cpu)(struct ib_device *dev,
                                               u64 dma_handle,
                                               size_t size,
@@ -2089,12 +2085,13 @@ 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
  * 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)
 {
  */
 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);
 }
 
        return sg_dma_address(sg);
 }
 
@@ -2102,12 +2099,13 @@ static inline u64 ib_sg_dma_address(struct ib_device *dev,
  * 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
  * 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)
 {
  */
 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);
 }
 
        return sg_dma_len(sg);
 }