From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 44A3CD4A4 for ; Fri, 10 Feb 2017 00:53:17 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2017 15:53:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,138,1484035200"; d="scan'208";a="819087957" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by FMSMGA003.fm.intel.com with ESMTP; 09 Feb 2017 15:53:16 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX102.ger.corp.intel.com ([169.254.2.230]) with mapi id 14.03.0248.002; Thu, 9 Feb 2017 23:53:15 +0000 From: "De Lara Guarch, Pablo" To: "Piasecki, JacekX" , "Doherty, Declan" CC: "dev@dpdk.org" , "Piasecki, JacekX" Thread-Topic: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression Thread-Index: AQHSghULI2OhAG4xqkCWO+aC1ei4ZKFhWovw Date: Thu, 9 Feb 2017 23:53:14 +0000 Message-ID: References: <1486569881-16220-1-git-send-email-jacekx.piasecki@intel.com> <1486569881-16220-2-git-send-email-jacekx.piasecki@intel.com> In-Reply-To: <1486569881-16220-2-git-send-email-jacekx.piasecki@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWNkYWQ4MTItOWJjOC00NDMxLWIxYTEtODE3OGM1MzViNmE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkNWWU9kWlwvKytDMWNEWVZhSm1IVnpOT0ZlUDU4QWM4QllsMmM2WldaZVVvPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 23:53:18 -0000 Hi Jacek, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jacek Piasecki > Sent: Wednesday, February 08, 2017 4:05 PM > To: Doherty, Declan > Cc: dev@dpdk.org; Piasecki, JacekX > Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of > expression >=20 > Fix problem of passing a pointer to sizeof() function. Now the size > of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS. >=20 > Coverity issue: 141068 > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test > application") >=20 > Signed-off-by: Jacek Piasecki > --- > app/test-crypto-perf/main.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c > index 634ea5f..dff906e 100644 > --- a/app/test-crypto-perf/main.c > +++ b/app/test-crypto-perf/main.c > @@ -39,13 +39,14 @@ > }; >=20 > static int > -cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t > *enabled_cdevs) > +cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t > *enabled_cdevs, > + uint8_t enabled_cdevs_dim) I think this extra parameter in the function is unnecessary, as it is always RTE_CRYPTO_MAX_DEVS. Better to pass RTE_CRYPTO_MAX_DEVS to rte_cryptodev_devices_get() directly. > { > uint8_t cdev_id, enabled_cdev_count =3D 0, nb_lcores; > int ret; >=20 > enabled_cdev_count =3D rte_cryptodev_devices_get(opts- > >device_type, > - enabled_cdevs, RTE_DIM(enabled_cdevs)); > + enabled_cdevs, enabled_cdevs_dim); Thanks, Pablo