diff mbox series

[v3,2/5] regex/mlx5: fix minsize build

Message ID 20210808125139.3573701-3-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series more build tests | expand

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Thomas Monjalon Aug. 8, 2021, 12:51 p.m. UTC
Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

drivers/regex/mlx5/mlx5_regex_fastpath.c:398:17: error:
‘len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                 complete_umr_wqe(qp, sq, &qp->jobs[mkey_job_id], sq->pi,
|                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                                  klm_num, len);
|                                  ~~~~~~~~~~~~~
drivers/regex/mlx5/mlx5_regex_fastpath.c:315:31: note: ‘len’ was declared here
|         uint32_t klm_num = 0, len;
|                               ^~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ruifeng Wang Aug. 11, 2021, 8:48 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Sunday, August 8, 2021 8:52 PM
> To: dev@dpdk.org
> Cc: bruce.richardson@intel.com; david.marchand@redhat.com; Ori Kam
> <orika@nvidia.com>
> Subject: [dpdk-dev] [PATCH v3 2/5] regex/mlx5: fix minsize build
> 
> Error occurs when configuring meson with --buildtype=minsize with GCC
> 11.1.0:
> 
> drivers/regex/mlx5/mlx5_regex_fastpath.c:398:17: error:
> ‘len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> |                 complete_umr_wqe(qp, sq, &qp->jobs[mkey_job_id], sq->pi,
> |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> |                                  klm_num, len);
> |                                  ~~~~~~~~~~~~~
> drivers/regex/mlx5/mlx5_regex_fastpath.c:315:31: note: ‘len’ was declared
> here
> |         uint32_t klm_num = 0, len;
> |                               ^~~
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/regex/mlx5/mlx5_regex_fastpath.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c
> b/drivers/regex/mlx5/mlx5_regex_fastpath.c
> index 786718af53..c79445ce7d 100644
> --- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
> +++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
> @@ -312,7 +312,8 @@ prep_regex_umr_wqe_set(struct mlx5_regex_priv
> *priv, struct mlx5_regex_qp *qp,
>  	struct mlx5_regex_job *job = NULL;
>  	size_t sqid = sq->sqn, mkey_job_id = 0;
>  	size_t left_ops = nb_ops;
> -	uint32_t klm_num = 0, len;
> +	uint32_t klm_num = 0;
> +	uint32_t len = 0;
>  	struct mlx5_klm *mkey_klm = NULL;
>  	struct mlx5_klm klm;
> 
> --
> 2.31.1
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
diff mbox series

Patch

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 786718af53..c79445ce7d 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -312,7 +312,8 @@  prep_regex_umr_wqe_set(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *qp,
 	struct mlx5_regex_job *job = NULL;
 	size_t sqid = sq->sqn, mkey_job_id = 0;
 	size_t left_ops = nb_ops;
-	uint32_t klm_num = 0, len;
+	uint32_t klm_num = 0;
+	uint32_t len = 0;
 	struct mlx5_klm *mkey_klm = NULL;
 	struct mlx5_klm klm;