From patchwork Mon May 22 18:49:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Godzwon X-Patchwork-Id: 127177 X-Patchwork-Delegate: gakhil@marvell.com 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 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 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; }