RDMA/mlx5: remove redundant check on err on return expression
Subsystems (3)
PATCH 1/1 RDMA/mlx5: remove redundant check on err on return expression
Currently all paths that set err and then check it for an error perform immediate returns, hence err always zero at the end of the function _mlx5r_umr_zap_mkey. The return expression err ? err : nblocks has a redundant check on the err since err is always zero, so just return nblocks instead.
--- drivers/infiniband/hw/mlx5/umr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/umr.c +1 -1
@@ -1050,7 +1050,7 @@ static int _mlx5r_umr_zap_mkey(struct mlx5_ib_mr *mr, } } -return err ? err : nblocks; +return nblocks; }/**
Signature · 1 line
2.50.0
Leon Romanovsky
AppliedQuoted 8 lines · Colin Ian King
Currently all paths that set err and then check it for an error perform immediate returns, hence err always zero at the end of the function
_mlx5r_umr_zap_mkey. The return expression err ? err : nblocks has a redundant check on the err since err is always zero, so just return nblocks instead.[...]
Applied, thanks!
[1/1] RDMA/mlx5: remove redundant check on err on return expression
https://git.kernel.org/rdma/rdma/c/aee80e6ffc5878
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>