From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 3DA001BCCF for ; Thu, 20 Dec 2018 18:07:17 +0100 (CET) Received: by mail-wm1-f65.google.com with SMTP id r24so12397402wmh.0 for ; Thu, 20 Dec 2018 09:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QyflGv3uVWe6WdAjb03D3aYliOhakZZdmEIM7SCbjak=; b=0GhS/pEO28cQKsicmUosrSECq1vm7UizMOcjioE635QR9cIPVfMaj6uOT6/zXGLYFw GJASRTAca8NKb6SfL2RW5mvVJ4toGBPo3rg+USt65gJypjQ7Z1n7DBSgFOSTkqJicDK+ +OsSNjJuLyOEXXnOrpHwkmEBIXKYi9XrihHIPkgRmAXFuDSwRJ9IEciYjUrOldgbf1NN nhdtb/tQvivRcFAIBPEfgn+9D4uYzZtqBz2uMwHScsVQuO5lUrRiJ3yT/bRVgMgxudPx O/EiuKzavT5iWWIOUhzJc7SlorV7YEULsccErHQaJI9W6zGUw5o+QU1Xnf2M993mkj2p 2kIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QyflGv3uVWe6WdAjb03D3aYliOhakZZdmEIM7SCbjak=; b=M8KSTsEO0dadsHh7EiSUhYsv1wrWn6PPzL4o8VTHlkfYmzJyWYJJD+I9ymT4WhpVTs Rcjrp78DLRRrF/J1WNmjhDVB3eqz54hkngJKNJSFuO+EqvINI2Afls0/glmh+p9JvNm6 hTm/t2RhhJDanDmoOcwzGE+kWT6PR3VoU8w2FhO6UueTAJSuH6wXVPy1CsPuP7d8Cy6n d2ovWrt5wauXq020Bq/skyMYNjyOVBX50pHRKBWgX9KtU09DtUL/zU86LTSSpEz0h87A YyhnNG/g7gulPZtUc1SdW3fmlT3wbAlhynRceKvtUt6sfTyxYkntP5s7ZeEEgdKXWuly WhMA== X-Gm-Message-State: AA+aEWa8fdXTcjugwGh9PQyaSWgYn1/aL6P1L6hKTZzLWTJXpjhlfvPo rQUEJuvES8SNSwtWjvIG7e0Glr9i8Cs= X-Google-Smtp-Source: AFSGD/XsIwy3vys3OLxj1hr4b/y0JyUu7IHwgVTwXcz5SyJjTz6x5ErizkboDrh8vX8Fjd8DMmRIEQ== X-Received: by 2002:a1c:b70b:: with SMTP id h11mr12669913wmf.72.1545325636248; Thu, 20 Dec 2018 09:07:16 -0800 (PST) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id n5sm11951688wrr.94.2018.12.20.09.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 09:07:15 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 20 Dec 2018 18:06:41 +0100 Message-Id: <1a4e58797e63142a15039bd288e746bb1c6684ce.1545325395.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 2/8] option: do not use static iterator 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, 20 Dec 2018 17:07:17 -0000 This is rather weird. Someone should have caught that during review. Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/rte_option.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/rte_option.c b/lib/librte_eal/common/rte_option.c index 3fbc13a6a..9e233f7d2 100644 --- a/lib/librte_eal/common/rte_option.c +++ b/lib/librte_eal/common/rte_option.c @@ -15,11 +15,11 @@ TAILQ_HEAD(rte_option_list, rte_option); struct rte_option_list rte_option_list = TAILQ_HEAD_INITIALIZER(rte_option_list); -static struct rte_option *option; - int rte_option_parse(const char *opt) { + struct rte_option *option; + if (strlen(opt) <= 2 || strncmp(opt, "--", 2)) return -1; @@ -38,6 +38,8 @@ rte_option_parse(const char *opt) void __rte_experimental rte_option_register(struct rte_option *opt) { + struct rte_option *option; + TAILQ_FOREACH(option, &rte_option_list, next) { if (strcmp(opt->opt_str, option->opt_str) == 0) { RTE_LOG(INFO, EAL, "Option %s has already been registered.\n", @@ -52,6 +54,8 @@ rte_option_register(struct rte_option *opt) void rte_option_init(void) { + struct rte_option *option; + TAILQ_FOREACH(option, &rte_option_list, next) { if (option->enabled) option->cb(); -- 2.19.1