From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH 1/2] eal: remove dead code in corelist parsing Date: Wed, 13 Feb 2019 21:06:58 +0100 Message-ID: <1550088419-10812-1-git-send-email-david.marchand@redhat.com> Cc: didier.pallard@6wind.com, thomas@monjalon.net, hari.kumarx.vemula@intel.com, stable@dpdk.org To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" We don't need to look for trailing spaces. This is a copy/paste block from eal_parse_coremask(). Remove it and the associated comment. Fixes: d888cb8b9613 ("eal: add core list input format") Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_options.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index b766252..c89f7ab 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -567,10 +567,10 @@ static int xdigit2val(unsigned char c) eal_parse_corelist(const char *corelist) { struct rte_config *cfg = rte_eal_get_configuration(); - int i, idx = 0; unsigned count = 0; char *end = NULL; int min, max; + int idx; if (eal_service_cores_parsed()) RTE_LOG(WARNING, EAL, @@ -580,12 +580,9 @@ static int xdigit2val(unsigned char c) if (corelist == NULL) return -1; - /* Remove all blank characters ahead and after */ + /* Remove all blank characters ahead */ while (isblank(*corelist)) corelist++; - i = strlen(corelist); - while ((i > 0) && isblank(corelist[i - 1])) - i--; /* Reset config */ for (idx = 0; idx < RTE_MAX_LCORE; idx++) { -- 1.8.3.1