]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/mlx5: remove redundant check on err on return expression
authorColin Ian King <colin.i.king@gmail.com>
Thu, 17 Jul 2025 11:21:08 +0000 (12:21 +0100)
committerLeon Romanovsky <leon@kernel.org>
Thu, 17 Jul 2025 12:19:19 +0000 (08:19 -0400)
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.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250717112108.4036171-1-colin.i.king@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/umr.c

index b097d8839cad090c69415558b3694698f45cfa25..fa5c4ea685b9d058850bbeefccf18330c224e772 100644 (file)
@@ -1050,7 +1050,7 @@ static int _mlx5r_umr_zap_mkey(struct mlx5_ib_mr *mr,
                }
        }
 
-       return err ? err : nblocks;
+       return nblocks;
 }
 
 /**