lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1582646588-91471-1-git-send-email-xiangxia.m.yue@gmail.com>
Date:   Wed, 26 Feb 2020 00:03:08 +0800
From:   xiangxia.m.yue@...il.com
To:     gerlitz.or@...il.com, roid@...lanox.com, saeedm@....mellanox.co.il
Cc:     netdev@...r.kernel.org, Tonghao Zhang <xiangxia.m.yue@...il.com>
Subject: [net-next] net/mlx5e: Remove the unnecessary parameter

From: Tonghao Zhang <xiangxia.m.yue@...il.com>

The parameter desired_size is always 0, and there is only one
function calling the mlx5_esw_chains_get_avail_sz_from_pool.
Deleting the parameter desired_size.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@...il.com>
---
 .../net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
index c5a446e..ce5b7e1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c
@@ -134,19 +134,14 @@ static unsigned int mlx5_esw_chains_get_level_range(struct mlx5_eswitch *esw)
 	return FDB_TC_LEVELS_PER_PRIO;
 }
 
-#define POOL_NEXT_SIZE 0
 static int
-mlx5_esw_chains_get_avail_sz_from_pool(struct mlx5_eswitch *esw,
-				       int desired_size)
+mlx5_esw_chains_get_avail_sz_from_pool(struct mlx5_eswitch *esw)
 {
 	int i, found_i = -1;
 
 	for (i = ARRAY_SIZE(ESW_POOLS) - 1; i >= 0; i--) {
-		if (fdb_pool_left(esw)[i] && ESW_POOLS[i] > desired_size) {
+		if (fdb_pool_left(esw)[i])
 			found_i = i;
-			if (desired_size != POOL_NEXT_SIZE)
-				break;
-		}
 	}
 
 	if (found_i != -1) {
@@ -198,7 +193,7 @@ static unsigned int mlx5_esw_chains_get_level_range(struct mlx5_eswitch *esw)
 		ft_attr.flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
 				  MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
 
-	sz = mlx5_esw_chains_get_avail_sz_from_pool(esw, POOL_NEXT_SIZE);
+	sz = mlx5_esw_chains_get_avail_sz_from_pool(esw);
 	if (!sz)
 		return ERR_PTR(-ENOSPC);
 	ft_attr.max_fte = sz;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ