DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] vhost/crypto: fix build with asserts
@ 2025-03-05  9:43 David Marchand
  2025-03-05  9:48 ` Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Marchand @ 2025-03-05  9:43 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia, Akhil Goyal, Gowrishankar Muthukrishnan

../lib/vhost/vhost_crypto.c: In function ‘virtio_crypto_asym_rsa_der_to_xform’:
../lib/vhost/vhost_crypto.c:538:42: warning: comparison of integer expressions
	of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’}
	[-Wsign-compare]
  538 |         RTE_ASSERT((tlv + len - &der[0]) == der_len);
      |                                          ^~
../lib/eal/include/rte_branch_prediction.h:43:45: note: in definition of macro
	‘unlikely’
   43 | #define unlikely(x)     __builtin_expect(!!(x), 0)
      |                                             ^
../lib/eal/include/rte_debug.h:47:25: note: in expansion of macro ‘RTE_VERIFY’
   47 | #define RTE_ASSERT(exp) RTE_VERIFY(exp)
      |                         ^~~~~~~~~~
../lib/vhost/vhost_crypto.c:538:9: note: in expansion of macro ‘RTE_ASSERT’
  538 |         RTE_ASSERT((tlv + len - &der[0]) == der_len);
      |         ^~~~~~~~~~

Fixes: d1b484bf1876 ("vhost/crypto: support asymmetric RSA")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/vhost/vhost_crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index 8dd1806a39..3c6c5dc114 100644
--- a/lib/vhost/vhost_crypto.c
+++ b/lib/vhost/vhost_crypto.c
@@ -535,7 +535,7 @@ virtio_crypto_asym_rsa_der_to_xform(uint8_t *der, size_t der_len,
 	xform->rsa.qt.qInv.data = qinv;
 	xform->rsa.qt.qInv.length = qinvlen;
 
-	RTE_ASSERT((tlv + len - &der[0]) == der_len);
+	RTE_ASSERT(tlv + len == der + der_len);
 	return 0;
 }
 
-- 
2.48.1


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

end of thread, other threads:[~2025-03-05 11:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-05  9:43 [PATCH] vhost/crypto: fix build with asserts David Marchand
2025-03-05  9:48 ` Maxime Coquelin
2025-03-05 11:00   ` Thomas Monjalon
2025-03-05  9:54 ` [EXTERNAL] " Gowrishankar Muthukrishnan
2025-03-05 10:43 ` Ali Alnubani

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