Commit 293d8440 authored by Kamal Heib's avatar Kamal Heib Committed by Jason Gunthorpe

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: 8700e3e7 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20200705104313.283034-4-kamalheib1@gmail.comSigned-off-by: default avatarKamal Heib <kamalheib1@gmail.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 9d576eac
...@@ -103,7 +103,7 @@ enum copy_direction { ...@@ -103,7 +103,7 @@ enum copy_direction {
from_mem_obj, from_mem_obj,
}; };
int rxe_mem_init_dma(struct rxe_pd *pd, void rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem); int access, struct rxe_mem *mem);
int rxe_mem_init_user(struct rxe_pd *pd, u64 start, int rxe_mem_init_user(struct rxe_pd *pd, u64 start,
......
...@@ -144,7 +144,7 @@ static int rxe_mem_alloc(struct rxe_mem *mem, int num_buf) ...@@ -144,7 +144,7 @@ static int rxe_mem_alloc(struct rxe_mem *mem, int num_buf)
return -ENOMEM; return -ENOMEM;
} }
int rxe_mem_init_dma(struct rxe_pd *pd, void rxe_mem_init_dma(struct rxe_pd *pd,
int access, struct rxe_mem *mem) int access, struct rxe_mem *mem)
{ {
rxe_mem_init(access, mem); rxe_mem_init(access, mem);
...@@ -153,8 +153,6 @@ int rxe_mem_init_dma(struct rxe_pd *pd, ...@@ -153,8 +153,6 @@ int rxe_mem_init_dma(struct rxe_pd *pd,
mem->access = access; mem->access = access;
mem->state = RXE_MEM_STATE_VALID; mem->state = RXE_MEM_STATE_VALID;
mem->type = RXE_MEM_TYPE_DMA; mem->type = RXE_MEM_TYPE_DMA;
return 0;
} }
int rxe_mem_init_user(struct rxe_pd *pd, u64 start, int rxe_mem_init_user(struct rxe_pd *pd, u64 start,
......
...@@ -901,30 +901,16 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access) ...@@ -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_dev *rxe = to_rdev(ibpd->device);
struct rxe_pd *pd = to_rpd(ibpd); struct rxe_pd *pd = to_rpd(ibpd);
struct rxe_mem *mr; struct rxe_mem *mr;
int err;
mr = rxe_alloc(&rxe->mr_pool); mr = rxe_alloc(&rxe->mr_pool);
if (!mr) { if (!mr)
err = -ENOMEM; return ERR_PTR(-ENOMEM);
goto err1;
}
rxe_add_index(mr); rxe_add_index(mr);
rxe_add_ref(pd); rxe_add_ref(pd);
rxe_mem_init_dma(pd, access, mr);
err = rxe_mem_init_dma(pd, access, mr);
if (err)
goto err2;
return &mr->ibmr; 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, static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment