[PATCH v2 8/8] net/sfc: fix calloc parameters
Ferruh Yigit
ferruh.yigit at amd.com
Wed Jan 24 19:54:05 CET 2024
gcc [1] generates warning [2] about rte_calloc usage, because
rte_calloc parameter order is wrong, fixing it by replacing parameters.
[1]
gcc (GCC) 14.0.1 20240124 (experimental)
[2]
Compiling C object drivers/libtmp_rte_net_sfc.a.p/net_sfc_sfc_mae.c.o
../net/sfc/sfc_mae.c: In function ‘sfc_mae_action_set_list_add’:
../drivers/net/sfc/sfc_mae.c:1353:35:
warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
argument and not in the later argument [-Wcalloc-transposed-args]
1353 | sizeof(struct sfc_mae_action_set *),
| ^~~~~~
Fixes: 002f591f54c3 ("net/sfc: support packet replay in transfer flows")
Cc: stable at dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
Cc: ivan.malov at arknetworks.am
---
drivers/net/sfc/sfc_mae.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index e5ec0ae49d4d..60ff6d21810a 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1350,8 +1350,8 @@ sfc_mae_action_set_list_add(struct sfc_adapter *sa,
action_set_list->action_sets =
rte_calloc("sfc_mae_action_set_list_action_sets",
- sizeof(struct sfc_mae_action_set *),
- action_set_list->nb_action_sets, 0);
+ action_set_list->nb_action_sets,
+ sizeof(struct sfc_mae_action_set *), 0);
if (action_set_list->action_sets == NULL) {
sfc_err(sa, "failed to allocate action set list");
rte_free(action_set_list);
--
2.34.1
More information about the stable
mailing list