From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v2 1/2] eal: remove redundant codes to parse --lcores Date: Tue, 26 Jul 2016 11:51:57 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B820CA@irsmsx105.ger.corp.intel.com> References: <1469081018-55300-1-git-send-email-wei.dai@intel.com> <1469526749-19698-1-git-send-email-wei.dai@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Dai, Wei" To: "Dai, Wei" , "dev@dpdk.org" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 280132951 for ; Tue, 26 Jul 2016 13:52:09 +0200 (CEST) In-Reply-To: <1469526749-19698-1-git-send-email-wei.dai@intel.com> Content-Language: en-US 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" > -----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_parse= _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_eal/= 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--; I suppose originally it meant to do something like that: while ((i > 0) && isblank(lcores[i - 1])) lcores[i--] =3D 0; to get rid of blank characters at the end of the line, no? Konstantin >=20 > CPU_ZERO(&cpuset); >=20 > -- > 2.5.5