RDMA/rxe: Return void from rxe_mem_init_dma()

The return value from rxe_mem_init_dma() is always 0 - change it to be
void and fix the callers accordingly.

Fixes: 8700e3e7c4 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20200705104313.283034-4-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
Kamal Heib 2020-07-05 13:43:12 +03:00 committed by Jason Gunthorpe
parent 9d576eac63
commit 293d8440a0
3 changed files with 7 additions and 23 deletions

View File

@ -103,8 +103,8 @@ enum copy_direction {
from_mem_obj,
};
int rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem);
void rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem);
int rxe_mem_init_user(struct rxe_pd *pd, u64 start,
u64 length, u64 iova, int access, struct ib_udata *udata,

View File

@ -144,8 +144,8 @@ err1:
return -ENOMEM;
}
int rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem)
void rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem)
{
rxe_mem_init(access, mem);
@ -153,8 +153,6 @@ int rxe_mem_init_dma(struct rxe_pd *pd,
mem->access = access;
mem->state = RXE_MEM_STATE_VALID;
mem->type = RXE_MEM_TYPE_DMA;
return 0;
}
int rxe_mem_init_user(struct rxe_pd *pd, u64 start,

View File

@ -901,30 +901,16 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
struct rxe_dev *rxe = to_rdev(ibpd->device);
struct rxe_pd *pd = to_rpd(ibpd);
struct rxe_mem *mr;
int err;
mr = rxe_alloc(&rxe->mr_pool);
if (!mr) {
err = -ENOMEM;
goto err1;
}
if (!mr)
return ERR_PTR(-ENOMEM);
rxe_add_index(mr);
rxe_add_ref(pd);
err = rxe_mem_init_dma(pd, access, mr);
if (err)
goto err2;
rxe_mem_init_dma(pd, access, mr);
return &mr->ibmr;
err2:
rxe_drop_ref(pd);
rxe_drop_index(mr);
rxe_drop_ref(mr);
err1:
return ERR_PTR(err);
}
static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd,