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, Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html