From 51d7396440f85846dcf8d098ff6d97713d621178 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Sun, 8 Aug 2021 14:51:35 +0200 Subject: [PATCH] regex/mlx5: fix minsize build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ruifeng Wang --- 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.39.5