Skip to contentSkip to conversation

net/mlx5: DR, remove redundant object_range assignment

PATCH In review Qasim Ijaz 3 participants 3 messages Mar 24, 2025 – Mar 26, 2025

Subsystems (4)
lore
Share & tools
lore

Qasim Ijaz

author
#0 lore raw

PATCH 1/1 net/mlx5: DR, remove redundant object_range assignment

The initial assignment of object_range from pool->dmn->info.caps.log_header_modify_argument_granularity is redundant because it is immediately overwritten by the max_t() call.

Remove the unnecessary assignment.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +0 -3
index 01ed6442095d..c2218dc556c7 100644
@@ -39,9 +39,6 @@ static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool)
 
 	INIT_LIST_HEAD(&cur_list);
 
-	object_range =
-		pool->dmn->info.caps.log_header_modify_argument_granularity;
-
 	object_range =
 		max_t(u32, pool->dmn->info.caps.log_header_modify_argument_granularity,
 		      DR_ICM_MODIFY_HDR_GRANULARITY_4K);
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Qasim Ijaz

The initial assignment of object_range from pool->dmn->info.caps.log_header_modify_argument_granularity is redundant because it is immediately overwritten by the max_t() call.

Remove the unnecessary assignment.

---
  drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +0 -0
index 01ed6442095d..c2218dc556c7 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool) · line 44

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +0 -3
@@ -39,9 +39,6 @@ static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool)
 
  	INIT_LIST_HEAD(&cur_list);
 
-	object_range =
-		pool->dmn->info.caps.log_header_modify_argument_granularity;
-
  	object_range =
  		max_t(u32, pool->dmn->info.caps.log_header_modify_argument_granularity,
  		      DR_ICM_MODIFY_HDR_GRANULARITY_4K);
Acked-by on v1 1/1
#2 lore raw
In reply to Qasim Ijaz
Quoted 16 lines · Qasim Ijaz

The initial assignment of object_range from pool->dmn->info.caps.log_header_modify_argument_granularity is redundant because it is immediately overwritten by the max_t() call.

Remove the unnecessary assignment.

---
  drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +0 -0
index 01ed6442095d..c2218dc556c7 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool) · line 44

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +0 -3
@@ -39,9 +39,6 @@ static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool)
 
  	INIT_LIST_HEAD(&cur_list);
 
-	object_range =
-		pool->dmn->info.caps.log_header_modify_argument_granularity;
-
  	object_range =
  		max_t(u32, pool->dmn->info.caps.log_header_modify_argument_granularity,
  		      DR_ICM_MODIFY_HDR_GRANULARITY_4K);

Thanks for your patch.
This is net-next material. Please specify target branch in future submissions.

Regards,
Tariq