gcc [1] generates warning [2] about calloc usage, because calloc parameter order is wrong, fixing it by replacing parameters.
[1] gcc (GCC) 14.0.1 20240124 (experimental) [2] Compiling C object lib/librte_dmadev.a.p/dmadev_rte_dmadev.c.o ../lib/dmadev/rte_dmadev.c: In function ‘dmadev_handle_dev_dump’: ../lib/dmadev/rte_dmadev.c:1033:29: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 1033 | buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); | ^~~~ Fixes: 94043b04212a ("dmadev: support telemetry dump dmadev") Cc: sta...@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yi...@amd.com> --- Cc: fengcheng...@huawei.com --- lib/dmadev/rte_dmadev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 5953a77bd6f9..c4e909270058 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -1030,7 +1030,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused, if (*end_param != '\0') RTE_DMA_LOG(WARNING, "Extra parameters passed to dmadev telemetry command, ignoring"); - buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); + buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char)); if (buf == NULL) return -ENOMEM; -- 2.34.1