DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/cryptodev: avoid implicit conversion to 64 bit number
@ 2024-11-28  1:53 Andre Muezerie
  2024-11-28  1:53 ` [PATCH 2/2] lib/hash: " Andre Muezerie
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Muezerie @ 2024-11-28  1:53 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang; +Cc: dev, Andre Muezerie

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.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.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.0.vfs.0.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-28  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28  1:53 [PATCH 1/2] lib/cryptodev: avoid implicit conversion to 64 bit number Andre Muezerie
2024-11-28  1:53 ` [PATCH 2/2] lib/hash: " Andre Muezerie

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).