[dpdk-dev,v2] app/test-crypto-perf: fix incorrect size of expression

Message ID 1486733175-24640-1-git-send-email-jacekx.piasecki@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Jacek Piasecki Feb. 10, 2017, 1:26 p.m. UTC
  Fix problem of passing a pointer to sizeof() function. Now the size
of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS.

Coverity issue: 141068
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
---
v2:
* RTE_CRYPTO_MAX_DEVS is passed to rte_cryptodev_devices_get() directly

 app/test-crypto-perf/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

De Lara Guarch, Pablo Feb. 10, 2017, 11:28 a.m. UTC | #1
> -----Original Message-----
> From: Piasecki, JacekX
> Sent: Friday, February 10, 2017 1:26 PM
> To: Doherty, Declan
> Cc: dev@dpdk.org; De Lara Guarch, Pablo; Piasecki, JacekX
> Subject: [PATCH v2] app/test-crypto-perf: fix incorrect size of expression
> 
> Fix problem of passing a pointer to sizeof() function. Now the size
> of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS.
> 
> Coverity issue: 141068
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
De Lara Guarch, Pablo Feb. 10, 2017, 11:48 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Friday, February 10, 2017 11:29 AM
> To: Piasecki, JacekX; Doherty, Declan
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] app/test-crypto-perf: fix incorrect size of
> expression
> 
> 
> 
> > -----Original Message-----
> > From: Piasecki, JacekX
> > Sent: Friday, February 10, 2017 1:26 PM
> > To: Doherty, Declan
> > Cc: dev@dpdk.org; De Lara Guarch, Pablo; Piasecki, JacekX
> > Subject: [PATCH v2] app/test-crypto-perf: fix incorrect size of expression
> >
> > Fix problem of passing a pointer to sizeof() function. Now the size
> > of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS.
> >
> > Coverity issue: 141068
> > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> > application")
> >
> > Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo
  

Patch

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 634ea5f..ac4f484 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -45,7 +45,7 @@ 
 	int ret;
 
 	enabled_cdev_count = rte_cryptodev_devices_get(opts->device_type,
-			enabled_cdevs, RTE_DIM(enabled_cdevs));
+			enabled_cdevs, RTE_CRYPTO_MAX_DEVS);
 	if (enabled_cdev_count == 0) {
 		printf("No crypto devices type %s available\n",
 				opts->device_type);