* [PATCH v3 1/3] lib/cryptodev: avoid implicit conversion to 64 bit number
[not found] <1732758837-6350-1-git-send-email-andremue@linux.microsoft.com>
@ 2025-01-27 19:33 ` Andre Muezerie
2025-02-06 12:08 ` [EXTERNAL] " Akhil Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Andre Muezerie @ 2025-01-27 19:33 UTC (permalink / raw)
To: andremue; +Cc: dev, fanzhang.oss, gakhil, mb, stable
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 <andremue@linux.microsoft.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [EXTERNAL] [PATCH v3 1/3] lib/cryptodev: avoid implicit conversion to 64 bit number
2025-01-27 19:33 ` [PATCH v3 1/3] lib/cryptodev: avoid implicit conversion to 64 bit number Andre Muezerie
@ 2025-02-06 12:08 ` Akhil Goyal
0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2025-02-06 12:08 UTC (permalink / raw)
To: Andre Muezerie; +Cc: dev, fanzhang.oss, mb, stable
> 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 <andremue@linux.microsoft.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
V2 of this patch was already applied to dpdk-next-crypto.
Now the other patches of the series are also applied.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-06 12:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1732758837-6350-1-git-send-email-andremue@linux.microsoft.com>
2025-01-27 19:33 ` [PATCH v3 1/3] lib/cryptodev: avoid implicit conversion to 64 bit number Andre Muezerie
2025-02-06 12:08 ` [EXTERNAL] " Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).