net/mlx5: HWS, fixed error flow return values of some functions
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Wed, 11 Sep 2024 20:17:44 +0000 (13:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Sep 2024 03:50:27 +0000 (20:50 -0700)
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>
Link: https://patch.msgid.link/20240911201757.1505453-3-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c

index 1964261415aa9f7b259a818bd150e92174d0965b..33d2b31e4b4645bbd9c3dd8baa64e0a518f07909 100644 (file)
@@ -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) {
index c79ee70edf03e58cd38c723740c009f4f249a4be..8a011b958b431cf822e21c1bdb7ab00f5b9aaab1 100644 (file)
@@ -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;
 }
index 9dbc3e9da5ea96e439a9d3f3b6b2128ae6d3180a..8c063a8d87d7dcc1378e6b588cb03bf23eca0dd4 100644 (file)
@@ -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;
 }