Re: [PATCH rdma-next] RDMA/mlx5: Refactor transport domain checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 19, 2018 at 01:33:31PM -0600, Jason Gunthorpe wrote:
> On Tue, Jun 19, 2018 at 10:39:06AM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> >
> > Put all relevant checks for transport domain in one place.
> >
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> >  drivers/infiniband/hw/mlx5/main.c | 22 ++++++++++++----------
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index 97113957398d..0b7d547bb857 100644
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -1582,7 +1582,10 @@ static int deallocate_uars(struct mlx5_ib_dev *dev, struct mlx5_ib_ucontext *con
> >
> >  static int mlx5_ib_alloc_transport_domain(struct mlx5_ib_dev *dev, u32 *tdn)
> >  {
> > -	int err;
> > +	int err = 0;
> > +
> > +	if (!MLX5_CAP_GEN(dev->mdev, log_max_transport_domain))
> > +		return err;
> >
> >  	err = mlx5_core_alloc_transport_domain(dev->mdev, tdn);
> >  	if (err)
>
> I revised this to
>
> 	int err;
>
> 	if (!MLX5_CAP_GEN(dev->mdev, log_max_transport_domain))
> 		return 0;
>
> Which is must clearer that no transport domains is not a failure than
> relying on the err pre-initialization..
>
> Otherwise, applied to for-next

Thanks

>
> Thanks,
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux