diff mbox series

[net-next,02/15] net/mlx5: HWS, fixed error flow return values of some functions

Message ID 20240911201757.1505453-3-saeed@kernel.org (mailing list archive)
State Accepted
Commit 3f4c38df5b0f51823df48851a56fd489f0e97545
Delegated to: Netdev Maintainers
Headers show
Series [net-next,01/15] net/mlx5: HWS, updated API functions comments to kernel doc | expand

Checks

Context Check Description
netdev/series_format success Pull request is its own cover letter
netdev/tree_selection success Clearly marked for 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: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
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: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 41 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-09-12--00-00 (tests: 764)

Commit Message

Saeed Mahameed Sept. 11, 2024, 8:17 p.m. UTC
From: Yevgeny Kliteynik <kliteyn@nvidia.com>

Fixed all the '-ret' returns in error flow of functions to 'ret',
as the internal functions are already returning negative error values
(e.g. -EINVAL)

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c     | 2 +-
 .../mellanox/mlx5/core/steering/hws/mlx5hws_rule.c        | 8 ++++----
 .../mellanox/mlx5/core/steering/hws/mlx5hws_table.c       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

Comments

Jacob Keller Sept. 12, 2024, 6:52 p.m. UTC | #1
On 9/11/2024 1:17 PM, Saeed Mahameed wrote:
> From: Yevgeny Kliteynik <kliteyn@nvidia.com>
> 
> Fixed all the '-ret' returns in error flow of functions to 'ret',
> as the internal functions are already returning negative error values
> (e.g. -EINVAL)
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c
index 1964261415aa..33d2b31e4b46 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c
@@ -967,7 +967,7 @@  int mlx5hws_matcher_attach_at(struct mlx5hws_matcher *matcher,
 
 	ret = hws_matcher_check_and_process_at(matcher, at);
 	if (ret)
-		return -ret;
+		return ret;
 
 	required_stes = at->num_of_action_stes - (!is_jumbo || at->only_term);
 	if (matcher->action_ste[MLX5HWS_ACTION_STE_IDX_ANY].max_stes < required_stes) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c
index c79ee70edf03..8a011b958b43 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c
@@ -751,11 +751,11 @@  int mlx5hws_rule_destroy(struct mlx5hws_rule *rule,
 
 	ret = hws_rule_enqueue_precheck(rule, attr);
 	if (unlikely(ret))
-		return -ret;
+		return ret;
 
 	ret = hws_rule_destroy_hws(rule, attr);
 
-	return -ret;
+	return ret;
 }
 
 int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
@@ -767,7 +767,7 @@  int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
 
 	ret = hws_rule_enqueue_precheck_update(rule, attr);
 	if (unlikely(ret))
-		return -ret;
+		return ret;
 
 	ret = hws_rule_create_hws(rule,
 				  attr,
@@ -776,5 +776,5 @@  int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
 				  at_idx,
 				  rule_actions);
 
-	return -ret;
+	return ret;
 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c
index 9dbc3e9da5ea..8c063a8d87d7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c
@@ -489,5 +489,5 @@  int mlx5hws_table_set_default_miss(struct mlx5hws_table *tbl,
 	return 0;
 out:
 	mutex_unlock(&ctx->ctrl_lock);
-	return -ret;
+	return ret;
 }