patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/2] pipeline: fix calloc parameters
@ 2023-11-02 13:08 Ferruh Yigit
  2023-11-02 13:08 ` [PATCH 2/2] net/nfp: " Ferruh Yigit
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Ferruh Yigit @ 2023-11-02 13:08 UTC (permalink / raw)
  To: Cristian Dumitrescu, Kamalakannan R; +Cc: dev, stable

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
 Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
.../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
 2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
      |           ^

.../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
 4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
      |           ^

Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline build")
Fixes: 54cae37ef4ef ("pipeline: support I/O specification")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: cristian.dumitrescu@intel.com
---
 lib/pipeline/rte_swx_pipeline_spec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 2bba0d0524d0..17419e7b854b 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -2890,7 +2890,7 @@ pipeline_spec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_spec), 1);
+	s = calloc(1, sizeof(struct pipeline_spec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
@@ -4241,7 +4241,7 @@ pipeline_iospec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_iospec), 1);
+	s = calloc(1, sizeof(struct pipeline_iospec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 2/2] net/nfp: fix calloc parameters
  2023-11-02 13:08 [PATCH 1/2] pipeline: fix calloc parameters Ferruh Yigit
@ 2023-11-02 13:08 ` Ferruh Yigit
  2023-11-03  1:26   ` Chaoyong He
  2023-11-06 14:26 ` [PATCH 1/2] pipeline: " Dumitrescu, Cristian
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
  2 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2023-11-02 13:08 UTC (permalink / raw)
  To: Chaoyong He, Alejandro Lucero; +Cc: dev, stable

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
.../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
  171 |         mutex = calloc(sizeof(*mutex), 1);
      |               ^

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: alejandro.lucero@netronome.com
---
 drivers/net/nfp/nfpcore/nfp_mutex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 3c10c7a090c0..edb78dfdc917 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -168,7 +168,7 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	if (tmp != key)
 		return NULL;
 
-	mutex = calloc(sizeof(*mutex), 1);
+	mutex = calloc(1, sizeof(*mutex));
 	if (mutex == NULL)
 		return NULL;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH 2/2] net/nfp: fix calloc parameters
  2023-11-02 13:08 ` [PATCH 2/2] net/nfp: " Ferruh Yigit
@ 2023-11-03  1:26   ` Chaoyong He
  0 siblings, 0 replies; 27+ messages in thread
From: Chaoyong He @ 2023-11-03  1:26 UTC (permalink / raw)
  To: Ferruh Yigit, Alejandro Lucero; +Cc: dev, stable

> gcc [1] generates warning [2] about calloc usage, because calloc parameter
> order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20231102 (experimental)
> 
> [2]
> Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
> .../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
> ../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
>   171 |         mutex = calloc(sizeof(*mutex), 1);
>       |               ^
> 
> Fixes: c7e9729da6b5 ("net/nfp: support CPP")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
> Cc: alejandro.lucero@netronome.com
> ---
>  drivers/net/nfp/nfpcore/nfp_mutex.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c
> b/drivers/net/nfp/nfpcore/nfp_mutex.c
> index 3c10c7a090c0..edb78dfdc917 100644
> --- a/drivers/net/nfp/nfpcore/nfp_mutex.c
> +++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
> @@ -168,7 +168,7 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
>  	if (tmp != key)
>  		return NULL;
> 
> -	mutex = calloc(sizeof(*mutex), 1);
> +	mutex = calloc(1, sizeof(*mutex));
>  	if (mutex == NULL)
>  		return NULL;
> 
> --
> 2.34.1

Thanks for fix it.

Acked-by: Chaoyong He <chaoyong.he@corigine.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH 1/2] pipeline: fix calloc parameters
  2023-11-02 13:08 [PATCH 1/2] pipeline: fix calloc parameters Ferruh Yigit
  2023-11-02 13:08 ` [PATCH 2/2] net/nfp: " Ferruh Yigit
@ 2023-11-06 14:26 ` Dumitrescu, Cristian
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
  2 siblings, 0 replies; 27+ messages in thread
From: Dumitrescu, Cristian @ 2023-11-06 14:26 UTC (permalink / raw)
  To: Ferruh Yigit, R, Kamalakannan; +Cc: dev, stable



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Thursday, November 2, 2023 1:09 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; R, Kamalakannan
> <kamalakannan.r@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH 1/2] pipeline: fix calloc parameters
> 
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20231102 (experimental)
> 
> [2]
>  Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
>  2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
>       |           ^
> 
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
>  4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
>       |           ^
> 
> Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline
> build")
> Fixes: 54cae37ef4ef ("pipeline: support I/O specification")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 1/8] pipeline: fix calloc parameters
  2023-11-02 13:08 [PATCH 1/2] pipeline: fix calloc parameters Ferruh Yigit
  2023-11-02 13:08 ` [PATCH 2/2] net/nfp: " Ferruh Yigit
  2023-11-06 14:26 ` [PATCH 1/2] pipeline: " Dumitrescu, Cristian
@ 2024-01-24 18:53 ` Ferruh Yigit
  2024-01-24 18:53   ` [PATCH v2 2/8] net/nfp: " Ferruh Yigit
                     ` (8 more replies)
  2 siblings, 9 replies; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:53 UTC (permalink / raw)
  To: Cristian Dumitrescu, Kamalakannan R; +Cc: dev, stable

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
 Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
.../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
 2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
      |           ^

.../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
 4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
      |           ^

Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline build")
Fixes: 54cae37ef4ef ("pipeline: support I/O specification")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
Cc: cristian.dumitrescu@intel.com
---
 lib/pipeline/rte_swx_pipeline_spec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 2bba0d0524d0..17419e7b854b 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -2890,7 +2890,7 @@ pipeline_spec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_spec), 1);
+	s = calloc(1, sizeof(struct pipeline_spec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
@@ -4241,7 +4241,7 @@ pipeline_iospec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_iospec), 1);
+	s = calloc(1, sizeof(struct pipeline_iospec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 2/8] net/nfp: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
@ 2024-01-24 18:53   ` Ferruh Yigit
  2024-01-24 19:01     ` Morten Brørup
  2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
                     ` (7 subsequent siblings)
  8 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:53 UTC (permalink / raw)
  To: Chaoyong He, Alejandro Lucero; +Cc: dev, stable

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
.../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
  171 |         mutex = calloc(sizeof(*mutex), 1);
      |               ^

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
---
Cc: alejandro.lucero@netronome.com
---
 drivers/net/nfp/nfpcore/nfp_mutex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 3c10c7a090c0..edb78dfdc917 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -168,7 +168,7 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	if (tmp != key)
 		return NULL;
 
-	mutex = calloc(sizeof(*mutex), 1);
+	mutex = calloc(1, sizeof(*mutex));
 	if (mutex == NULL)
 		return NULL;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 3/8] rawdev: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
  2024-01-24 18:53   ` [PATCH v2 2/8] net/nfp: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
                       ` (2 more replies)
  2024-01-24 18:54   ` [PATCH v2 4/8] eventdev: " Ferruh Yigit
                     ` (6 subsequent siblings)
  8 siblings, 3 replies; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Sachin Saxena, Hemant Agrawal, Morten Brørup, Chengwen Feng
  Cc: dev, stable

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20240108 (experimental)

[2]
Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
../lib/rawdev/rte_rawdev.c:659:29:
  error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument
  [-Werror=calloc-transposed-args]
  659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: fengchengwen@huawei.com
---
 lib/rawdev/rte_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index 474bdc95407f..4f8897b63947 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -656,7 +656,7 @@ handle_dev_dump(const char *cmd __rte_unused,
 	if (!rte_rawdev_pmd_is_valid_dev(dev_id))
 		return -EINVAL;
 
-	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


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 4/8] eventdev: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
  2024-01-24 18:53   ` [PATCH v2 2/8] net/nfp: " Ferruh Yigit
  2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:34     ` fengchengwen
  2024-01-24 18:54   ` [PATCH v2 5/8] dmadev: " Ferruh Yigit
                     ` (5 subsequent siblings)
  8 siblings, 2 replies; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Jerin Jacob, Chengwen Feng, Morten Brørup; +Cc: dev, stable

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_eventdev.a.p/eventdev_rte_eventdev.c.o
../lib/eventdev/rte_eventdev.c: In function ‘handle_dev_dump’:
../lib/eventdev/rte_eventdev.c:2005:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 2005 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: a3b7b476d723 ("eventdev: support telemetry dump eventdev")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: fengchengwen@huawei.com
---
 lib/eventdev/rte_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 157752868d5b..1c865e993fec 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -2002,7 +2002,7 @@ handle_dev_dump(const char *cmd __rte_unused,
 
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
 
-	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


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 5/8] dmadev: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (2 preceding siblings ...)
  2024-01-24 18:54   ` [PATCH v2 4/8] eventdev: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:35     ` fengchengwen
  2024-01-24 18:54   ` [PATCH v2 6/8] common/mlx5: " Ferruh Yigit
                     ` (4 subsequent siblings)
  8 siblings, 2 replies; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Chengwen Feng, Kevin Laatz, Bruce Richardson, Morten Brørup
  Cc: dev, stable

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: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: fengchengwen@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


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 6/8] common/mlx5: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (3 preceding siblings ...)
  2024-01-24 18:54   ` [PATCH v2 5/8] dmadev: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 19:01     ` Morten Brørup
  2024-01-24 18:54   ` [PATCH v2 7/8] net/bnx2x: " Ferruh Yigit
                     ` (3 subsequent siblings)
  8 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Dariusz Sosnowski, Viacheslav Ovsiienko, Ori Kam, Suanming Mou,
	Matan Azrad, Dmitry Kozlyuk
  Cc: dev, stable, dkozlyuk

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 .../common_mlx5_mlx5_common_mr.c.o
.../mlx5/mlx5_common_mr.c: In function ‘mlx5_mempool_get_chunks’:
.../common/mlx5/mlx5_common_mr.c:1384:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 1384 |         *out = calloc(sizeof(**out), n);
      |                             ^

Fixes: 7297d2cdecce ("common/mlx5: fix external memory pool registration")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: dkozlyuk@nvidia.com
---
 drivers/common/mlx5/mlx5_common_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 40ff9153bd8e..85ec10d2ee36 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -1381,7 +1381,7 @@ mlx5_mempool_get_chunks(struct rte_mempool *mp, struct mlx5_range **out,
 
 	DRV_LOG(DEBUG, "Collecting chunks of regular mempool %s", mp->name);
 	n = mp->nb_mem_chunks;
-	*out = calloc(sizeof(**out), n);
+	*out = calloc(n, sizeof(**out));
 	if (*out == NULL)
 		return -1;
 	rte_mempool_mem_iter(mp, mlx5_range_from_mempool_chunk, *out);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 7/8] net/bnx2x: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (4 preceding siblings ...)
  2024-01-24 18:54   ` [PATCH v2 6/8] common/mlx5: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 19:01     ` Morten Brørup
  2024-01-24 18:54   ` [PATCH v2 8/8] net/sfc: " Ferruh Yigit
                     ` (2 subsequent siblings)
  8 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Julien Aube, Harish Patil, Stephen Hemminger; +Cc: dev, stable

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_bnx2x.a.p/net_bnx2x_bnx2x.c.o
../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_alloc_ilt_lines_mem’:
../drivers/net/bnx2x/bnx2x.c:2392:44:
 warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
 argument and not in the later argument [-Wcalloc-transposed-args]
 2392 |                     sizeof(struct ilt_line), ILT_MAX_LINES,
      |                            ^~~~~~

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: stephen@networkplumber.org
---
 drivers/net/bnx2x/bnx2x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index c3283c94f38f..597ee4335977 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2389,7 +2389,7 @@ int bnx2x_alloc_ilt_mem(struct bnx2x_softc *sc)
 static int bnx2x_alloc_ilt_lines_mem(struct bnx2x_softc *sc)
 {
 	sc->ilt->lines = rte_calloc("",
-				    sizeof(struct ilt_line), ILT_MAX_LINES,
+				    ILT_MAX_LINES, sizeof(struct ilt_line),
 				    RTE_CACHE_LINE_SIZE);
 	return sc->ilt->lines == NULL;
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 8/8] net/sfc: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (5 preceding siblings ...)
  2024-01-24 18:54   ` [PATCH v2 7/8] net/bnx2x: " Ferruh Yigit
@ 2024-01-24 18:54   ` Ferruh Yigit
  2024-01-24 19:02     ` Morten Brørup
  2024-01-24 19:00   ` [PATCH v2 1/8] pipeline: " Morten Brørup
  2024-02-18 16:08   ` Thomas Monjalon
  8 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2024-01-24 18:54 UTC (permalink / raw)
  To: Andrew Rybchenko, Andy Moreton, Ivan Malov; +Cc: dev, stable

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@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: ivan.malov@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


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 4/8] eventdev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 4/8] eventdev: " Ferruh Yigit
@ 2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:34     ` fengchengwen
  1 sibling, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 18:59 UTC (permalink / raw)
  To: Ferruh Yigit, Jerin Jacob, Chengwen Feng; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> 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_eventdev.a.p/eventdev_rte_eventdev.c.o
> ../lib/eventdev/rte_eventdev.c: In function ‘handle_dev_dump’:
> ../lib/eventdev/rte_eventdev.c:2005:29:
>   warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument [-Wcalloc-transposed-args]
>  2005 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
>       |                         ^~~~
> 
> Fixes: a3b7b476d723 ("eventdev: support telemetry dump eventdev")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 3/8] rawdev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
@ 2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:34     ` fengchengwen
  2024-01-25  3:39     ` Hemant Agrawal
  2 siblings, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 18:59 UTC (permalink / raw)
  To: Ferruh Yigit, Sachin Saxena, Hemant Agrawal, Chengwen Feng; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20240108 (experimental)
> 
> [2]
> Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
> ../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
> ../lib/rawdev/rte_rawdev.c:659:29:
>   error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument
>   [-Werror=calloc-transposed-args]
>   659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
>       |                         ^~~~
> 
> Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 5/8] dmadev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 5/8] dmadev: " Ferruh Yigit
@ 2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:35     ` fengchengwen
  1 sibling, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 18:59 UTC (permalink / raw)
  To: Ferruh Yigit, Chengwen Feng, Kevin Laatz, Bruce Richardson; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> To: Chengwen Feng; Kevin Laatz; Bruce Richardson; Morten Brørup
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH v2 5/8] dmadev: fix calloc parameters
> 
> 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: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 1/8] pipeline: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (6 preceding siblings ...)
  2024-01-24 18:54   ` [PATCH v2 8/8] net/sfc: " Ferruh Yigit
@ 2024-01-24 19:00   ` Morten Brørup
  2024-02-18 16:08   ` Thomas Monjalon
  8 siblings, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 19:00 UTC (permalink / raw)
  To: Ferruh Yigit, Cristian Dumitrescu, Kamalakannan R; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20231102 (experimental)
> 
> [2]
>  Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
>  2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
>       |           ^
> 
> .../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
> ../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
>  4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
>       |           ^
> 
> Fixes: 30c4abb90942 ("pipeline: rework specification file-based
> pipeline build")
> Fixes: 54cae37ef4ef ("pipeline: support I/O specification")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 2/8] net/nfp: fix calloc parameters
  2024-01-24 18:53   ` [PATCH v2 2/8] net/nfp: " Ferruh Yigit
@ 2024-01-24 19:01     ` Morten Brørup
  0 siblings, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 19:01 UTC (permalink / raw)
  To: Ferruh Yigit, Chaoyong He, Alejandro Lucero; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20231102 (experimental)
> 
> [2]
> Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
> .../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
> ../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
>   warning: allocation of insufficient size ‘1’ for type
>            ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
>   171 |         mutex = calloc(sizeof(*mutex), 1);
>       |               ^
> 
> Fixes: c7e9729da6b5 ("net/nfp: support CPP")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> Acked-by: Chaoyong He <chaoyong.he@corigine.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 6/8] common/mlx5: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 6/8] common/mlx5: " Ferruh Yigit
@ 2024-01-24 19:01     ` Morten Brørup
  2024-01-26 10:12       ` Dariusz Sosnowski
  0 siblings, 1 reply; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 19:01 UTC (permalink / raw)
  To: Ferruh Yigit, Dariusz Sosnowski, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, Matan Azrad, Dmitry Kozlyuk
  Cc: dev, stable, dkozlyuk

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> 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 .../common_mlx5_mlx5_common_mr.c.o
> .../mlx5/mlx5_common_mr.c: In function ‘mlx5_mempool_get_chunks’:
> .../common/mlx5/mlx5_common_mr.c:1384:29:
>   warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument [-Wcalloc-transposed-args]
>  1384 |         *out = calloc(sizeof(**out), n);
>       |                             ^
> 
> Fixes: 7297d2cdecce ("common/mlx5: fix external memory pool
> registration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 7/8] net/bnx2x: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 7/8] net/bnx2x: " Ferruh Yigit
@ 2024-01-24 19:01     ` Morten Brørup
  0 siblings, 0 replies; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 19:01 UTC (permalink / raw)
  To: Ferruh Yigit, Julien Aube, Harish Patil, Stephen Hemminger; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> 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_bnx2x.a.p/net_bnx2x_bnx2x.c.o
> ../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_alloc_ilt_lines_mem’:
> ../drivers/net/bnx2x/bnx2x.c:2392:44:
>  warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
>  argument and not in the later argument [-Wcalloc-transposed-args]
>  2392 |                     sizeof(struct ilt_line), ILT_MAX_LINES,
>       |                            ^~~~~~
> 
> Fixes: 540a211084a7 ("bnx2x: driver core")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 8/8] net/sfc: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 8/8] net/sfc: " Ferruh Yigit
@ 2024-01-24 19:02     ` Morten Brørup
  2024-01-25  7:10       ` Andrew Rybchenko
  0 siblings, 1 reply; 27+ messages in thread
From: Morten Brørup @ 2024-01-24 19:02 UTC (permalink / raw)
  To: Ferruh Yigit, Andrew Rybchenko, Andy Moreton, Ivan Malov; +Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Wednesday, 24 January 2024 19.54
> 
> 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@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 3/8] rawdev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
@ 2024-01-25  2:34     ` fengchengwen
  2024-01-25  3:39     ` Hemant Agrawal
  2 siblings, 0 replies; 27+ messages in thread
From: fengchengwen @ 2024-01-25  2:34 UTC (permalink / raw)
  To: Ferruh Yigit, Sachin Saxena, Hemant Agrawal, Morten Brørup
  Cc: dev, stable

Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>

Thanks

On 2024/1/25 2:54, Ferruh Yigit wrote:
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20240108 (experimental)
> 
> [2]
> Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
> ../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
> ../lib/rawdev/rte_rawdev.c:659:29:
>   error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument
>   [-Werror=calloc-transposed-args]
>   659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
>       |                         ^~~~
> 
> Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
> Cc: fengchengwen@huawei.com
> ---
>  lib/rawdev/rte_rawdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
> index 474bdc95407f..4f8897b63947 100644
> --- a/lib/rawdev/rte_rawdev.c
> +++ b/lib/rawdev/rte_rawdev.c
> @@ -656,7 +656,7 @@ handle_dev_dump(const char *cmd __rte_unused,
>  	if (!rte_rawdev_pmd_is_valid_dev(dev_id))
>  		return -EINVAL;
>  
> -	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;
>  
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 4/8] eventdev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 4/8] eventdev: " Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
@ 2024-01-25  2:34     ` fengchengwen
  1 sibling, 0 replies; 27+ messages in thread
From: fengchengwen @ 2024-01-25  2:34 UTC (permalink / raw)
  To: Ferruh Yigit, Jerin Jacob, Morten Brørup; +Cc: dev, stable

Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>

Thanks

On 2024/1/25 2:54, Ferruh Yigit wrote:
> 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_eventdev.a.p/eventdev_rte_eventdev.c.o
> ../lib/eventdev/rte_eventdev.c: In function ‘handle_dev_dump’:
> ../lib/eventdev/rte_eventdev.c:2005:29:
>   warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument [-Wcalloc-transposed-args]
>  2005 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
>       |                         ^~~~
> 
> Fixes: a3b7b476d723 ("eventdev: support telemetry dump eventdev")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
> Cc: fengchengwen@huawei.com
> ---
>  lib/eventdev/rte_eventdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 157752868d5b..1c865e993fec 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -2002,7 +2002,7 @@ handle_dev_dump(const char *cmd __rte_unused,
>  
>  	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
>  
> -	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;
>  
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 5/8] dmadev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 5/8] dmadev: " Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
@ 2024-01-25  2:35     ` fengchengwen
  1 sibling, 0 replies; 27+ messages in thread
From: fengchengwen @ 2024-01-25  2:35 UTC (permalink / raw)
  To: Ferruh Yigit, Kevin Laatz, Bruce Richardson, Morten Brørup
  Cc: dev, stable

Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>

Thanks

On 2024/1/25 2:54, Ferruh Yigit wrote:
> 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: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
> Cc: fengchengwen@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;
>  
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 3/8] rawdev: fix calloc parameters
  2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
  2024-01-24 18:59     ` Morten Brørup
  2024-01-25  2:34     ` fengchengwen
@ 2024-01-25  3:39     ` Hemant Agrawal
  2 siblings, 0 replies; 27+ messages in thread
From: Hemant Agrawal @ 2024-01-25  3:39 UTC (permalink / raw)
  To: Ferruh Yigit, Sachin Saxena, Morten Brørup, Chengwen Feng
  Cc: dev, stable

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]



> gcc [1] generates warning [2] about calloc usage, because calloc parameter
> order is wrong, fixing it by replacing parameters.
> 
> [1]
> gcc (GCC) 14.0.0 20240108 (experimental)
> 
> [2]
> Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
> ../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
> ../lib/rawdev/rte_rawdev.c:659:29:
>   error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
>   argument and not in the later argument
>   [-Werror=calloc-transposed-args]
>   659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
>       |                         ^~~~
> 
> Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>

Reviewed-by:  Hemant Agrawal <hemant.agrawal@nxp.com>

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 8/8] net/sfc: fix calloc parameters
  2024-01-24 19:02     ` Morten Brørup
@ 2024-01-25  7:10       ` Andrew Rybchenko
  0 siblings, 0 replies; 27+ messages in thread
From: Andrew Rybchenko @ 2024-01-25  7:10 UTC (permalink / raw)
  To: Morten Brørup, Ferruh Yigit, Andy Moreton, Ivan Malov; +Cc: dev, stable

On 1/24/24 22:02, Morten Brørup wrote:
>> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
>> Sent: Wednesday, 24 January 2024 19.54
>>
>> 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@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
>> ---
> 
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> 

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v2 6/8] common/mlx5: fix calloc parameters
  2024-01-24 19:01     ` Morten Brørup
@ 2024-01-26 10:12       ` Dariusz Sosnowski
  0 siblings, 0 replies; 27+ messages in thread
From: Dariusz Sosnowski @ 2024-01-26 10:12 UTC (permalink / raw)
  To: Morten Brørup, Ferruh Yigit, Slava Ovsiienko, Ori Kam,
	Suanming Mou, Matan Azrad, Dmitry Kozlyuk
  Cc: dev, stable, dkozlyuk

> -----Original Message-----
> From: Morten Brørup <mb@smartsharesystems.com>
> Sent: Wednesday, January 24, 2024 20:01
> To: Ferruh Yigit <ferruh.yigit@amd.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori
> Kam <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad <matan@nvidia.com>; Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Cc: dev@dpdk.org; stable@dpdk.org; dkozlyuk@nvidia.com
> Subject: RE: [PATCH v2 6/8] common/mlx5: fix calloc parameters 
> 
> > From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> > Sent: Wednesday, 24 January 2024 19.54
> >
> > 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 .../common_mlx5_mlx5_common_mr.c.o
> > .../mlx5/mlx5_common_mr.c: In function ‘mlx5_mempool_get_chunks’:
> > .../common/mlx5/mlx5_common_mr.c:1384:29:
> >   warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
> >   argument and not in the later argument [-Wcalloc-transposed-args]
> >  1384 |         *out = calloc(sizeof(**out), n);
> >       |                             ^
> >
> > Fixes: 7297d2cdecce ("common/mlx5: fix external memory pool
> > registration")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> > ---
> 
> Acked-by: Morten Brørup <mb@smartsharesystems.com>

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 1/8] pipeline: fix calloc parameters
  2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
                     ` (7 preceding siblings ...)
  2024-01-24 19:00   ` [PATCH v2 1/8] pipeline: " Morten Brørup
@ 2024-02-18 16:08   ` Thomas Monjalon
  8 siblings, 0 replies; 27+ messages in thread
From: Thomas Monjalon @ 2024-02-18 16:08 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Cristian Dumitrescu, Kamalakannan R, dev, stable

24/01/2024 19:53, Ferruh Yigit:
> gcc [1] generates warning [2] about calloc usage, because calloc
> parameter order is wrong, fixing it by replacing parameters.

Series applied, thanks.




^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2024-02-18 16:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 13:08 [PATCH 1/2] pipeline: fix calloc parameters Ferruh Yigit
2023-11-02 13:08 ` [PATCH 2/2] net/nfp: " Ferruh Yigit
2023-11-03  1:26   ` Chaoyong He
2023-11-06 14:26 ` [PATCH 1/2] pipeline: " Dumitrescu, Cristian
2024-01-24 18:53 ` [PATCH v2 1/8] " Ferruh Yigit
2024-01-24 18:53   ` [PATCH v2 2/8] net/nfp: " Ferruh Yigit
2024-01-24 19:01     ` Morten Brørup
2024-01-24 18:54   ` [PATCH v2 3/8] rawdev: " Ferruh Yigit
2024-01-24 18:59     ` Morten Brørup
2024-01-25  2:34     ` fengchengwen
2024-01-25  3:39     ` Hemant Agrawal
2024-01-24 18:54   ` [PATCH v2 4/8] eventdev: " Ferruh Yigit
2024-01-24 18:59     ` Morten Brørup
2024-01-25  2:34     ` fengchengwen
2024-01-24 18:54   ` [PATCH v2 5/8] dmadev: " Ferruh Yigit
2024-01-24 18:59     ` Morten Brørup
2024-01-25  2:35     ` fengchengwen
2024-01-24 18:54   ` [PATCH v2 6/8] common/mlx5: " Ferruh Yigit
2024-01-24 19:01     ` Morten Brørup
2024-01-26 10:12       ` Dariusz Sosnowski
2024-01-24 18:54   ` [PATCH v2 7/8] net/bnx2x: " Ferruh Yigit
2024-01-24 19:01     ` Morten Brørup
2024-01-24 18:54   ` [PATCH v2 8/8] net/sfc: " Ferruh Yigit
2024-01-24 19:02     ` Morten Brørup
2024-01-25  7:10       ` Andrew Rybchenko
2024-01-24 19:00   ` [PATCH v2 1/8] pipeline: " Morten Brørup
2024-02-18 16:08   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).