diff mbox series

net/mlx5: remove redundant assignment to variable object_range

Message ID 20240206165815.2420951-1-colin.i.king@gmail.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series net/mlx5: remove redundant assignment to variable object_range | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1048 this patch: 1048
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 8 maintainers not CCed: kliteyn@nvidia.com muhammads@nvidia.com valex@nvidia.com nathan@kernel.org morbo@google.com justinstitt@google.com ndesaulniers@google.com llvm@lists.linux.dev
netdev/build_clang success Errors and warnings before: 1065 this patch: 1065
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1065 this patch: 1065
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-07--15-00 (tests: 682)

Commit Message

Colin Ian King Feb. 6, 2024, 4:58 p.m. UTC
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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Simon Horman Feb. 7, 2024, 9:48 a.m. UTC | #1
On Tue, Feb 06, 2024 at 04:58:15PM +0000, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Thanks Colin,

Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c
index 01ed6442095d..c2218dc556c7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c
@@ -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);