A few nits:

On 07/12/2015 22:43, Dennis Dalessandro wrote:
> +static int rvt_map_sg(struct ib_device *dev, struct scatterlist *sgl,
> +                   int nents, enum dma_data_direction direction)
> +{
> +     struct scatterlist *sg;
> +     u64 addr;
> +     int i;
> +     int ret = nents;
> +
> +     if (WARN_ON(!valid_dma_direction(direction)))
> +             return BAD_DMA_ADDRESS;
The function returns 0 on error, so its technically correct, but it
doesn't return a DMA address, so I think it would make more sense to
return 0 here and not BAD_DMA_ADDRESS.

> +
> +     for_each_sg(sgl, sg, nents, i) {
> +             addr = (u64)page_address(sg_page(sg));
> +             if (!addr) {
> +                     ret = 0;
> +                     break;
> +             }
> +             sg->dma_address = addr + sg->offset;
> +#ifdef CONFIG_NEED_SG_DMA_LENGTH
> +             sg->dma_length = sg->length;
> +#endif
> +     }
> +     return ret;
> +}

> diff --git a/drivers/infiniband/sw/rdmavt/vt.h 
> b/drivers/infiniband/sw/rdmavt/vt.h
> index ec210f3..a19a3af 100644
> --- a/drivers/infiniband/sw/rdmavt/vt.h
> +++ b/drivers/infiniband/sw/rdmavt/vt.h
> @@ -52,5 +52,6 @@
>   */
>  
>  #include <rdma/rdma_vt.h>
> +#include "dma.h"
Why do you need the dma.h file included here? Won't it be enough to
include it in vt.c?

Regards,
Haggai
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to