On Tue, Jul 26, 2016 at 11:51:57AM +0000, Ananyev, Konstantin wrote: > > hi Wei, > > -----Original Message----- > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wei Dai > > Sent: Tuesday, July 26, 2016 10:52 AM > > To: dev at dpdk.org > > Cc: Dai, Wei <wei.dai at intel.com> > > Subject: [dpdk-dev] [PATCH v2 1/2] eal: remove redundant codes to parse > > --lcores > > > > local variable i is not referred by other codes in the function > > eal_parse_lcores( ), so it can be removed. > > > > Signed-off-by: Wei Dai <wei.dai at intel.com> > > --- > > lib/librte_eal/common/eal_common_options.c | 4 ---- > > 1 file changed, 4 deletions(-) > > > > 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 = rte_eal_get_configuration(); > > static uint16_t set[RTE_MAX_LCORE]; > > unsigned idx = 0; > > - int i; > > unsigned count = 0; > > const char *lcore_start = NULL; > > const char *end = NULL; > > @@ -593,9 +592,6 @@ eal_parse_lcores(const char *lcores) > > /* Remove all blank characters ahead and after */ > > while (isblank(*lcores)) > > lcores++; > > - i = 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--] = 0; totally agreed Konstantin, need to add lcore[i--] = '\0'
> > to get rid of blank characters at the end of the line, no? > Konstantin > > > > > CPU_ZERO(&cpuset); > > > > -- > > 2.5.5 Adam Bynes