From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Bynes Subject: Re: [PATCH v2 1/2] eal: remove redundant codes to parse --lcores Date: Tue, 26 Jul 2016 17:36:10 +0000 Message-ID: References: <1469081018-55300-1-git-send-email-wei.dai@intel.com> <1469526749-19698-1-git-send-email-wei.dai@intel.com> <2601191342CEEE43887BDE71AB97725836B820CA@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Dai, Wei" , "Ananyev, Konstantin" Return-path: Received: from BLU004-OMC1S5.hotmail.com (blu004-omc1s5.hotmail.com [65.55.116.16]) by dpdk.org (Postfix) with ESMTP id 1864F4AAD for ; Tue, 26 Jul 2016 19:36:16 +0200 (CEST) In-Reply-To: <2601191342CEEE43887BDE71AB97725836B820CA@irsmsx105.ger.corp.intel.com> Content-Language: en-US Content-ID: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jul 26, 2016 at 11:51:57AM +0000, Ananyev, Konstantin wrote: >=20 >=20 hi Wei, > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Dai > > Sent: Tuesday, July 26, 2016 10:52 AM > > To: dev@dpdk.org > > Cc: Dai, Wei > > Subject: [dpdk-dev] [PATCH v2 1/2] eal: remove redundant codes to parse= --lcores > >=20 > > local variable i is not referred by other codes in the function eal_par= se_lcores( ), so it can be removed. > >=20 > > Signed-off-by: Wei Dai > > --- > > lib/librte_eal/common/eal_common_options.c | 4 ---- > > 1 file changed, 4 deletions(-) > >=20 > > diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_ea= l/common/eal_common_options.c > > index 481c732..c5bf98c 100644 > > --- a/lib/librte_eal/common/eal_common_options.c > > +++ b/lib/librte_eal/common/eal_common_options.c > > @@ -578,7 +578,6 @@ eal_parse_lcores(const char *lcores) > > struct rte_config *cfg =3D rte_eal_get_configuration(); > > static uint16_t set[RTE_MAX_LCORE]; > > unsigned idx =3D 0; > > - int i; > > unsigned count =3D 0; > > const char *lcore_start =3D NULL; > > const char *end =3D NULL; > > @@ -593,9 +592,6 @@ eal_parse_lcores(const char *lcores) > > /* Remove all blank characters ahead and after */ > > while (isblank(*lcores)) > > lcores++; > > - i =3D strlen(lcores); > > - while ((i > 0) && isblank(lcores[i - 1])) > > - i--; >=20 > I suppose originally it meant to do something like that: > while ((i > 0) && isblank(lcores[i - 1])) > lcores[i--] =3D 0; totally agreed Konstantin, need to add lcore[i--] =3D '\0' >=20 > to get rid of blank characters at the end of the line, no? > Konstantin >=20 > >=20 > > CPU_ZERO(&cpuset); > >=20 > > -- > > 2.5.5 Adam Bynes