Skip to content

Commit a49b1dc

Browse files
Leon Romanovskydledford
authored andcommitted
RDMA: Convert destroy_wq to be void
All callers of destroy WQ are always success and there is no need to check their return value, so convert destroy_wq to be void. Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 8d18ad8 commit a49b1dc

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

drivers/infiniband/core/verbs.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,19 +2235,17 @@ EXPORT_SYMBOL(ib_create_wq);
22352235
*/
22362236
int ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata)
22372237
{
2238-
int err;
22392238
struct ib_cq *cq = wq->cq;
22402239
struct ib_pd *pd = wq->pd;
22412240

22422241
if (atomic_read(&wq->usecnt))
22432242
return -EBUSY;
22442243

2245-
err = wq->device->ops.destroy_wq(wq, udata);
2246-
if (!err) {
2247-
atomic_dec(&pd->usecnt);
2248-
atomic_dec(&cq->usecnt);
2249-
}
2250-
return err;
2244+
wq->device->ops.destroy_wq(wq, udata);
2245+
atomic_dec(&pd->usecnt);
2246+
atomic_dec(&cq->usecnt);
2247+
2248+
return 0;
22512249
}
22522250
EXPORT_SYMBOL(ib_destroy_wq);
22532251

drivers/infiniband/hw/mlx4/mlx4_ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ void mlx4_ib_sl2vl_update(struct mlx4_ib_dev *mdev, int port);
906906
struct ib_wq *mlx4_ib_create_wq(struct ib_pd *pd,
907907
struct ib_wq_init_attr *init_attr,
908908
struct ib_udata *udata);
909-
int mlx4_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata);
909+
void mlx4_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata);
910910
int mlx4_ib_modify_wq(struct ib_wq *wq, struct ib_wq_attr *wq_attr,
911911
u32 wq_attr_mask, struct ib_udata *udata);
912912

drivers/infiniband/hw/mlx4/qp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,7 +4248,7 @@ int mlx4_ib_modify_wq(struct ib_wq *ibwq, struct ib_wq_attr *wq_attr,
42484248
return err;
42494249
}
42504250

4251-
int mlx4_ib_destroy_wq(struct ib_wq *ibwq, struct ib_udata *udata)
4251+
void mlx4_ib_destroy_wq(struct ib_wq *ibwq, struct ib_udata *udata)
42524252
{
42534253
struct mlx4_ib_dev *dev = to_mdev(ibwq->device);
42544254
struct mlx4_ib_qp *qp = to_mqp((struct ib_qp *)ibwq);
@@ -4259,8 +4259,6 @@ int mlx4_ib_destroy_wq(struct ib_wq *ibwq, struct ib_udata *udata)
42594259
destroy_qp_common(dev, qp, MLX4_IB_RWQ_SRC, udata);
42604260

42614261
kfree(qp);
4262-
4263-
return 0;
42644262
}
42654263

42664264
struct ib_rwq_ind_table

drivers/infiniband/hw/mlx5/mlx5_ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ int mlx5_ib_check_mr_status(struct ib_mr *ibmr, u32 check_mask,
12011201
struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
12021202
struct ib_wq_init_attr *init_attr,
12031203
struct ib_udata *udata);
1204-
int mlx5_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata);
1204+
void mlx5_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata);
12051205
int mlx5_ib_modify_wq(struct ib_wq *wq, struct ib_wq_attr *wq_attr,
12061206
u32 wq_attr_mask, struct ib_udata *udata);
12071207
struct ib_rwq_ind_table *mlx5_ib_create_rwq_ind_table(struct ib_device *device,

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6047,16 +6047,14 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
60476047
return ERR_PTR(err);
60486048
}
60496049

6050-
int mlx5_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata)
6050+
void mlx5_ib_destroy_wq(struct ib_wq *wq, struct ib_udata *udata)
60516051
{
60526052
struct mlx5_ib_dev *dev = to_mdev(wq->device);
60536053
struct mlx5_ib_rwq *rwq = to_mrwq(wq);
60546054

60556055
mlx5_core_destroy_rq_tracked(dev->mdev, &rwq->core_qp);
60566056
destroy_user_rq(dev, wq->pd, rwq, udata);
60576057
kfree(rwq);
6058-
6059-
return 0;
60606058
}
60616059

60626060
struct ib_rwq_ind_table *mlx5_ib_create_rwq_ind_table(struct ib_device *device,

include/rdma/ib_verbs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ struct ib_device_ops {
25092509
struct ib_wq *(*create_wq)(struct ib_pd *pd,
25102510
struct ib_wq_init_attr *init_attr,
25112511
struct ib_udata *udata);
2512-
int (*destroy_wq)(struct ib_wq *wq, struct ib_udata *udata);
2512+
void (*destroy_wq)(struct ib_wq *wq, struct ib_udata *udata);
25132513
int (*modify_wq)(struct ib_wq *wq, struct ib_wq_attr *attr,
25142514
u32 wq_attr_mask, struct ib_udata *udata);
25152515
struct ib_rwq_ind_table *(*create_rwq_ind_table)(

0 commit comments

Comments
 (0)