From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B72842B76; Mon, 22 May 2023 21:06:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E63A140EE7; Mon, 22 May 2023 21:06:23 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id AE90340EE5 for ; Mon, 22 May 2023 21:06:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684782381; x=1716318381; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hp9QGc1Hjzxe+vKWfqcBT+/oI/Dv7qJwJvjjt13+Ai0=; b=WrZx73TsZE+kMROCW3QQJKzXD4Szph+BZRawAKfdot3YreIzzOZFyJSL 7hS3eM2e0QUA2uAR9Jes9TkLvx3JbhLXgTxOqvfU1f7rZZMhukqK6hG4/ J0IF09shK2yt2Pz6/2i7s+HWA9L9a64GSekU7BC5+SBuvi1M6e6U/47oU h8q7i8+ZRRczKxIpNop7c9eLRT5+7540hSWa0ut0K3hwivxQMSMZKpFYt h81ZmygYg+nTjb+vXV4A/rWiJcg46ifepbiwEMUt1IoDZgdxvzoml3rAg z7Ch7BI+lTAeF1QHJ6eRjeHwV74xB5WdfioK1qC/JRq4H0DZD+S5eWZQP Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="337603105" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="337603105" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 12:06:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="815801855" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="815801855" Received: from fedora37.igk.intel.com ([10.237.87.194]) by fmsmga002.fm.intel.com with ESMTP; 22 May 2023 12:06:18 -0700 From: Kamil Godzwon To: dev@dpdk.org Cc: Akhil Goyal , Fan Zhang Subject: [PATCH v2] lib/cryptodev: fix assertion to remove GCC compilation warning Date: Mon, 22 May 2023 15:04:52 -0400 Message-Id: <20230522190453.453281-1-kamilx.godzwon@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522184951.452626-1-kamilx.godzwon@intel.com> References: <20230522184951.452626-1-kamilx.godzwon@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 /home/vagrant/dpdk/build/include/rte_crypto_sym.h:1009:4: \ warning: Value stored to 'left' is never read [deadcode.DeadStores] left = 0; ^ ~ 1 warning generated. Compilator sees that the variable 'left' is never read after assignment a '0' value. To get rid of this warning message, use 'if' condition to verify the 'left' value before RTE_ASSERT. Signed-off-by: Kamil Godzwon --- v2: Changed commit message as the line was too long Removed braces --- lib/cryptodev/rte_crypto_sym.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index b43174dbec..dcef1a5049 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -1016,7 +1016,9 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, left -= seglen; } - RTE_ASSERT(left == 0); + if (left != 0) + RTE_ASSERT(false); + return i; } -- 2.40.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.