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 019E04613B; Mon, 27 Jan 2025 20:33:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2622D40B8D; Mon, 27 Jan 2025 20:33:19 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 29A354028F; Mon, 27 Jan 2025 20:33:18 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 51CC12037164; Mon, 27 Jan 2025 11:33:17 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 51CC12037164 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738006397; bh=BMU3VR41cMaPgPDtQKo5r6E4gy9BFqITsGxwlz26r4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wf9yEOAA6w2esvo52aCqDjwRVB07UrgNbiP84meKMslJTb2LkGgnNh3tBVIK2bNiS 5G09elvuIBHsmtUZgMkEN9HR1TQ14orHHAMxh1qtlqz+5QCd9uJB4oSW3XgsokjWSB 6Vi/zKqoBQ9V5P8GbU81ytPMKZjtFUgWchmLsllA= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: dev@dpdk.org, fanzhang.oss@gmail.com, gakhil@marvell.com, mb@smartsharesystems.com, stable@dpdk.org Subject: [PATCH v3 1/3] lib/cryptodev: avoid implicit conversion to 64 bit number Date: Mon, 27 Jan 2025 11:33:07 -0800 Message-Id: <1738006389-17193-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1732758837-6350-1-git-send-email-andremue@linux.microsoft.com> References: <1732758837-6350-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 MSVC issues the warning below: ../lib/cryptodev/rte_cryptodev.c(623): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) The code would be better off by using 64 bit numbers to begin with. That eliminates the need for a conversion to 64 bits later. This patch actually fixes a bug present in previous DPDK versions because the last of the hash enums RTE_CRYPTO_AUTH_SM3_HMAC in rte_crypto_auth_algorithm has value 32. Fixes: 6f8ef8b68edb ("cryptodev: add hash algorithms in asymmetric capability") Cc: stable@dpdk.org Signed-off-by: Andre Muezerie Acked-by: Akhil Goyal Reviewed-by: Morten Brørup --- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 85a4b46ac9..a49b0662f3 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -620,7 +620,7 @@ rte_cryptodev_asym_xform_capability_check_hash( { bool ret = false; - if (capability->hash_algos & (1 << hash)) + if (capability->hash_algos & RTE_BIT64(hash)) ret = true; rte_cryptodev_trace_asym_xform_capability_check_hash( -- 2.47.2.vfs.0.1