[dpdk-dev] [PATCH v1 2/8] option: do not use static iterator
Gaetan Rivet
gaetan.rivet at 6wind.com
Thu Dec 20 18:06:41 CET 2018
This is rather weird. Someone should have caught that during review.
Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
---
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
More information about the dev
mailing list