aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/profile.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/profile.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/profile.c b/drivers/net/ethernet/mellanox/mlx4/profile.c
index 2bf437aafc53..bae8b22edbb7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/profile.c
+++ b/drivers/net/ethernet/mellanox/mlx4/profile.c
@@ -82,7 +82,6 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
82 82
83 u64 total_size = 0; 83 u64 total_size = 0;
84 struct mlx4_resource *profile; 84 struct mlx4_resource *profile;
85 struct mlx4_resource tmp;
86 struct sysinfo si; 85 struct sysinfo si;
87 int i, j; 86 int i, j;
88 87
@@ -149,11 +148,8 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
149 */ 148 */
150 for (i = MLX4_RES_NUM; i > 0; --i) 149 for (i = MLX4_RES_NUM; i > 0; --i)
151 for (j = 1; j < i; ++j) { 150 for (j = 1; j < i; ++j) {
152 if (profile[j].size > profile[j - 1].size) { 151 if (profile[j].size > profile[j - 1].size)
153 tmp = profile[j]; 152 swap(profile[j], profile[j - 1]);
154 profile[j] = profile[j - 1];
155 profile[j - 1] = tmp;
156 }
157 } 153 }
158 154
159 for (i = 0; i < MLX4_RES_NUM; ++i) { 155 for (i = 0; i < MLX4_RES_NUM; ++i) {