RDMA/mlx5: Use max() macro for bfreg calculation
Subsystems (2)
PATCH 1/1 RDMA/mlx5: Use max() macro for bfreg calculation
Simplify the calculation of medium blue flame registers by using the max() macro instead of open-coded ternary logic. This improves readability and aligns with the subsystem's preference for using standard kernel helpers.
Signed-off-by Rohit Chavan <[email protected]>
--- drivers/infiniband/hw/mlx5/qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +1 -1
@@ -708,7 +708,7 @@ static int num_med_bfreg(struct mlx5_ib_dev *dev, n =max_bfregs (dev, bfregi) - bfregi->num_low_latency_bfregs -NUM_NON_BLUE_FLAME_BFREGS ; -return n >=0 ? n :0 ; +return max (n,0 ); } static int first_med_bfreg(struct mlx5_ib_dev *dev,
Signature · 1 line
2.34.1
Leon Romanovsky
AppliedQuoted 4 lines · Rohit Chavan
Simplify the calculation of medium blue flame registers by using the
max()macro instead of open-coded ternary logic. This improves readability and aligns with the subsystem's preference for using standard kernel helpers.
Applied, thanks!
[1/1] RDMA/mlx5: Use max() macro for bfreg calculation
https://git.kernel.org/rdma/rdma/c/4d957f6055768d
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>