Skip to contentSkip to conversation

net/mlx5: remove redundant assignment to variable object_range

PATCH In review Colin Ian King 2 participants 2 messages Feb 6, 2024 – Feb 7, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: remove redundant assignment to variable object_range

The variable object_range to log_header_modify_argument_granularity is being assigned a value that is never read, the following statement assigns object_range to the max of log_header_modify_argument_granularity and DR_ICM_MODIFY_HDR_GRANULARITY_4K, so clearly the initial assignment is redundant. Remove it.

Cleans up clang-scan build warning:
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c:42:2: warning:
Value stored to 'object_range' is never read [deadcode.DeadStores]

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/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.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Colin Ian King

The variable object_range to log_header_modify_argument_granularity is being assigned a value that is never read, the following statement assigns object_range to the max of log_header_modify_argument_granularity and DR_ICM_MODIFY_HDR_GRANULARITY_4K, so clearly the initial assignment is redundant. Remove it.

Cleans up clang-scan build warning:
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c:42:2: warning:
Value stored to 'object_range' is never read [deadcode.DeadStores]

Thanks Colin,