From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id EA1FD1B890 for ; Mon, 17 Dec 2018 11:19:40 +0100 (CET) Received: by mail-vs1-f66.google.com with SMTP id t17so7331683vsc.8 for ; Mon, 17 Dec 2018 02:19:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=El6brsbveTSko0MqRsRzPCy7hhaqYQ6ZYuF4a3mEsFg=; b=GyJkE4E5Y+s8AuLcCV8JXhq6I+oBLY4ZppzZaxXjywma6E3JPMXoVjo+MdyRHgYFh8 twOiYMbfG3Gk56wLw2Ni5CFpCa0MDwWcbfqtbs+oPvY308dkctFuJ63GB1ZbNlV7QWUh Ykq1Fps01xMNqDY1dmt2YFCLVOVAv7xQF+46Xm3omBTRrV8YoF1jHkgip496jkcudyL8 5F34nnvAghqfkbnnp/a43i072QEQ9xh4Zko6BYpxT7WBE3dvO3C1574oGO0pKcliuMnx TlrNK2OPR9nmyqllhqFRNzzhqkZsiuxepczU/JmA0R7GHlI/ku0cqj/XhUVxyadBBlzg YtqQ== X-Gm-Message-State: AA+aEWbKRvvNhh0vKiCI0hOj01BIsBW0BeMP97/j4uy7JKE6F923GALm DwgYCQVMYa3BNrVbwLYEPivIQYU1LoA1WedGC2b6LJcB X-Google-Smtp-Source: AFSGD/W0Wmvsl9/mausZNKufVxM+hsxF154OvYUfJmLpotAgXIhLkXdlfb6pIh0FG4mV0PpYGV0UL76J5OckIM8CJPo= X-Received: by 2002:a67:1b04:: with SMTP id b4mr6043117vsb.141.1545041980365; Mon, 17 Dec 2018 02:19:40 -0800 (PST) MIME-Version: 1.0 References: <20181217092559.21801-1-gaetan.rivet@6wind.com> In-Reply-To: <20181217092559.21801-1-gaetan.rivet@6wind.com> From: David Marchand Date: Mon, 17 Dec 2018 11:19:29 +0100 Message-ID: To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection 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: Mon, 17 Dec 2018 10:19:41 -0000 On Mon, Dec 17, 2018 at 10:26 AM Gaetan Rivet wrote: > Missing brackets around the if means that the loop will end at its first > iteration. > > Cc: stable@dpdk.org > > Fixes: 2395332798d0 ("eal: add option register infrastructure") > Signed-off-by: Gaetan Rivet > --- > lib/librte_eal/common/rte_option.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/rte_option.c > b/lib/librte_eal/common/rte_option.c > index 02d59a869..eefb8b923 100644 > --- a/lib/librte_eal/common/rte_option.c > +++ b/lib/librte_eal/common/rte_option.c > @@ -35,10 +35,11 @@ void __rte_experimental > rte_option_register(struct rte_option *opt) > { > TAILQ_FOREACH(option, &rte_option_list, next) { > - if (strcmp(opt->opt_str, option->opt_str) == 0) > + if (strcmp(opt->opt_str, option->opt_str) == 0) { > RTE_LOG(INFO, EAL, "Option %s has already been > registered.", > opt->opt_str); > return; > + } > } > > TAILQ_INSERT_HEAD(&rte_option_list, opt, next); > Reviewed-by: David Marchand Different topic but having a return code would be better than a simple log. -- David Marchand