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 8226842B76; Mon, 22 May 2023 20:51:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 118B540EE7; Mon, 22 May 2023 20:51:41 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id EC7B240EE5 for ; Mon, 22 May 2023 20:51:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684781500; x=1716317500; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=4OPL+n9M5xkDDKtX+qReK5dF2uOH21xHaNOCIG62Mdo=; b=Y9SAjg0fX/SPaaweUk2u1LQgbwkqzcCIIdckrd3C0rItyUr+aHFsxJCa fUZKl9KFVD3BQbfXwqN3FABQjunW6Sn1HJmbOc8Wew1GLeD1MpUB24dxy cQcdJeUhebHaIolfY33VYMtXjWVWpYm9Wt7QjO+/NU9JeF+3gVoYwZxQS clRDVWrZ+MmXN/Qx3EG5jdrA2cp7nfJ2rjrjzL5fMq/21mSMNMZDGt0zz lSPP+moUclrA8ZpiymmzKkBsSqh6lrcbGpzYkE3VX8GYpfu+WaZ/3mJqu UPjmyEF6WTETVYQUnfm3hhzTojawb/3DbQggG8oiqEHUkjNrxFOV5dQC/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="342464474" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="342464474" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 11:51:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="734383837" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="734383837" Received: from fedora37.igk.intel.com ([10.237.87.194]) by orsmga008.jf.intel.com with ESMTP; 22 May 2023 11:51:17 -0700 From: Kamil Godzwon To: dev@dpdk.org Cc: Akhil Goyal , Fan Zhang Subject: [PATCH] lib/cryptodev: fix assertion to remove GCC compilation warning Date: Mon, 22 May 2023 14:49:51 -0400 Message-Id: <20230522184951.452626-1-kamilx.godzwon@intel.com> X-Mailer: git-send-email 2.40.1 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 --- lib/cryptodev/rte_crypto_sym.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index b43174dbec..d7183a0b9e 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -1016,7 +1016,10 @@ 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.