From patchwork Wed Apr 21 13:57:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Dumitrescu X-Patchwork-Id: 91957 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 84B15A0547; Wed, 21 Apr 2021 15:57:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48B9341AC8; Wed, 21 Apr 2021 15:57:48 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 48B4C410F9 for ; Wed, 21 Apr 2021 15:57:47 +0200 (CEST) IronPort-SDR: R+6ANLv2oTgSFuitTdvjAq9bAC5qrfZamU/4G0eOWNQNYn/Xqv8ozISXv3bhVFRyZkPYrTHJrm DA2MxgyzWdhw== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="195726639" X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="195726639" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 06:57:46 -0700 IronPort-SDR: sJ6uNmu+y3MoYu0fi8BJz6ioZOD9Z0tbMnwi6lir7T/85R3n++85ADFvyix19zBEDe3mSFI02R YI7nKjysd4BA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="602902286" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.107]) by orsmga005.jf.intel.com with ESMTP; 21 Apr 2021 06:57:45 -0700 From: Cristian Dumitrescu To: dev@dpdk.org, alialnu@nvidia.com Date: Wed, 21 Apr 2021 14:57:44 +0100 Message-Id: <20210421135744.21114-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] pipeline: prevent some compiler warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some older versions of the GCC compiler may trigger the -Werror=maybe-uninitialized warning if some local variables are not initialized. Signed-off-by: Cristian Dumitrescu --- lib/librte_pipeline/rte_swx_pipeline.c | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c index 4e358bbda..1cc08659d 100644 --- a/lib/librte_pipeline/rte_swx_pipeline.c +++ b/lib/librte_pipeline/rte_swx_pipeline.c @@ -3624,7 +3624,7 @@ instr_mov_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -3889,7 +3889,7 @@ instr_alu_add_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -3942,7 +3942,7 @@ instr_alu_sub_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -4072,7 +4072,7 @@ instr_alu_shl_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -4125,7 +4125,7 @@ instr_alu_shr_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -4178,7 +4178,7 @@ instr_alu_and_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -4231,7 +4231,7 @@ instr_alu_or_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -4284,7 +4284,7 @@ instr_alu_xor_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *src = tokens[2]; struct field *fdst, *fsrc; uint64_t src_val; - uint32_t dst_struct_id, src_struct_id; + uint32_t dst_struct_id = 0, src_struct_id = 0; CHECK(n_tokens == 3, EINVAL); @@ -5162,7 +5162,7 @@ instr_regprefetch_translate(struct rte_swx_pipeline *p, char *regarray = tokens[1], *idx = tokens[2]; struct regarray *r; struct field *fidx; - uint32_t idx_struct_id, idx_val; + uint32_t idx_struct_id = 0, idx_val; CHECK(n_tokens == 3, EINVAL); @@ -5206,7 +5206,7 @@ instr_regrd_translate(struct rte_swx_pipeline *p, char *dst = tokens[1], *regarray = tokens[2], *idx = tokens[3]; struct regarray *r; struct field *fdst, *fidx; - uint32_t dst_struct_id, idx_struct_id, idx_val; + uint32_t dst_struct_id = 0, idx_struct_id = 0, idx_val; CHECK(n_tokens == 4, EINVAL); @@ -5265,7 +5265,7 @@ instr_regwr_translate(struct rte_swx_pipeline *p, struct regarray *r; struct field *fidx, *fsrc; uint64_t src_val; - uint32_t idx_struct_id, idx_val, src_struct_id; + uint32_t idx_struct_id = 0, idx_val, src_struct_id = 0; CHECK(n_tokens == 4, EINVAL); @@ -5354,7 +5354,7 @@ instr_regadd_translate(struct rte_swx_pipeline *p, struct regarray *r; struct field *fidx, *fsrc; uint64_t src_val; - uint32_t idx_struct_id, idx_val, src_struct_id; + uint32_t idx_struct_id = 0, idx_val, src_struct_id = 0; CHECK(n_tokens == 4, EINVAL); @@ -6064,7 +6064,7 @@ instr_metprefetch_translate(struct rte_swx_pipeline *p, char *metarray = tokens[1], *idx = tokens[2]; struct metarray *m; struct field *fidx; - uint32_t idx_struct_id, idx_val; + uint32_t idx_struct_id = 0, idx_val; CHECK(n_tokens == 3, EINVAL); @@ -6107,8 +6107,8 @@ instr_meter_translate(struct rte_swx_pipeline *p, char *color_in = tokens[4], *color_out = tokens[5]; struct metarray *m; struct field *fidx, *flength, *fcin, *fcout; - uint32_t idx_struct_id, length_struct_id; - uint32_t color_in_struct_id, color_out_struct_id; + uint32_t idx_struct_id = 0, length_struct_id = 0; + uint32_t color_in_struct_id = 0, color_out_struct_id = 0; CHECK(n_tokens == 6, EINVAL);