Skip to content

Commit d15525f

Browse files
kliteynSaeed Mahameed
authored andcommitted
net/mlx5: HWS, changed E2BIG error to a negative return code
Fixed all the 'E2BIG' returns in error flow of functions to the negative '-E2BIG' as we are using negative error codes everywhere in HWS code. This also fixes the following smatch warnings: "warn: was negative '-E2BIG' intended?" Fixes: 74a778b ("net/mlx5: HWS, added definers handling") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/f8c77688-7d83-4937-baba-ac844dfe2e0b@stanley.mountain/ Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent d8c5617 commit d15525f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx,
3333
* and let the usual match creation path handle it,
3434
* both for good and bad flows.
3535
*/
36-
if (ret == E2BIG) {
36+
if (ret == -E2BIG) {
3737
is_complex = true;
3838
mlx5hws_dbg(ctx, "Matcher definer layout: need complex matcher\n");
3939
} else {

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ hws_definer_find_best_match_fit(struct mlx5hws_context *ctx,
18451845
return 0;
18461846
}
18471847

1848-
return E2BIG;
1848+
return -E2BIG;
18491849
}
18501850

18511851
static void
@@ -1931,7 +1931,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx,
19311931
/* Find the match definer layout for header layout match union */
19321932
ret = hws_definer_find_best_match_fit(ctx, match_definer, match_hl);
19331933
if (ret) {
1934-
if (ret == E2BIG)
1934+
if (ret == -E2BIG)
19351935
mlx5hws_dbg(ctx,
19361936
"Failed to create match definer from header layout - E2BIG\n");
19371937
else

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static int hws_matcher_bind_mt(struct mlx5hws_matcher *matcher)
675675
if (!(matcher->flags & MLX5HWS_MATCHER_FLAGS_COLLISION)) {
676676
ret = mlx5hws_definer_mt_init(ctx, matcher->mt);
677677
if (ret) {
678-
if (ret == E2BIG)
678+
if (ret == -E2BIG)
679679
mlx5hws_err(ctx, "Failed to set matcher templates with match definers\n");
680680
return ret;
681681
}

0 commit comments

Comments
 (0)