On Wed, Sep 02, 2020 at 09:08:50PM -0300, Jason Gunthorpe wrote: > On Sun, Aug 30, 2020 at 11:40:05AM +0300, Leon Romanovsky wrote: > > -void mlx5_ib_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) > > +int mlx5_ib_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) > > { > > struct mlx5_ib_dev *dev = to_mdev(srq->device); > > struct mlx5_ib_srq *msrq = to_msrq(srq); > > + int ret; > > + > > + ret = mlx5_cmd_destroy_srq(dev, &msrq->msrq); > > + if (ret && udata) > > + return ret; > > > > - mlx5_cmd_destroy_srq(dev, &msrq->msrq); > > - > > - if (srq->uobject) { > > - mlx5_ib_db_unmap_user( > > - rdma_udata_to_drv_context( > > - udata, > > - struct mlx5_ib_ucontext, > > - ibucontext), > > - &msrq->db); > > - ib_umem_release(msrq->umem); > > - } else { > > - destroy_srq_kernel(dev, msrq); > > + if (udata) { > > + destroy_srq_user(srq->pd, msrq, udata); > > + return 0; > > } > > It is not a big deal but I would like to remove udata as an argument > to the driver destroy functions, it is completely nonsensical and > never used. 197 static void destroy_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq, 198 struct ib_udata *udata) 199 { 200 mlx5_ib_db_unmap_user( 201 rdma_udata_to_drv_context( 202 udata, ^^^^^^ in use 203 struct mlx5_ib_ucontext, 204 ibucontext), 205 &srq->db); 206 ib_umem_release(srq->umem); 207 } 208 > > Jason