Commit 2df1cafa authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller

net/mlx4: use swap() in mlx4_init_qp_table()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7161d18f
...@@ -749,7 +749,7 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) ...@@ -749,7 +749,7 @@ int mlx4_init_qp_table(struct mlx4_dev *dev)
{ {
int sort[MLX4_NUM_QP_REGION]; int sort[MLX4_NUM_QP_REGION];
int i, j, tmp; int i, j;
int last_base = dev->caps.num_qps; int last_base = dev->caps.num_qps;
for (i = 1; i < MLX4_NUM_QP_REGION; ++i) for (i = 1; i < MLX4_NUM_QP_REGION; ++i)
...@@ -758,11 +758,8 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) ...@@ -758,11 +758,8 @@ int mlx4_init_qp_table(struct mlx4_dev *dev)
for (i = MLX4_NUM_QP_REGION; i > MLX4_QP_REGION_BOTTOM; --i) { for (i = MLX4_NUM_QP_REGION; i > MLX4_QP_REGION_BOTTOM; --i) {
for (j = MLX4_QP_REGION_BOTTOM + 2; j < i; ++j) { for (j = MLX4_QP_REGION_BOTTOM + 2; j < i; ++j) {
if (dev->caps.reserved_qps_cnt[sort[j]] > if (dev->caps.reserved_qps_cnt[sort[j]] >
dev->caps.reserved_qps_cnt[sort[j - 1]]) { dev->caps.reserved_qps_cnt[sort[j - 1]])
tmp = sort[j]; swap(sort[j], sort[j - 1]);
sort[j] = sort[j - 1];
sort[j - 1] = tmp;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment