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 E73FD1B501 for ; Mon, 17 Dec 2018 11:19:40 +0100 (CET) Received: by mail-vs1-f66.google.com with SMTP id b74so7353290vsd.9 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=muACM7en+YEJZyw7Hd6h+IgQCNPlXusB/DxGZU8lwpsFSm0PApiUZBHKtrhve/v1Su M9sXYUiS5z8TXFUmlHXvJ0AxYJrRgjNEa4hUAtq4ip++7TwUrrc+Gp4X0jzVy7mMt6F1 1pqXnxgO31fG/rttmb9EPJVcgGDnCT4y8tRr0Tlg+ORlnnMGwLW1uN2KeEgiAOm6dvlw XTPg5Go07/2PuHzxtI+qH6hiHuDrKrnABsRw/GheaZYluUd+NriH2yVVYLKqdYn2N7xK gi0/CvyZ0QFCiyodFyS2Mlo7qI68UKL/eB+oqA4pWg/652aijkSwp3TO9tmRA4aDFR71 XYhA== X-Gm-Message-State: AA+aEWaF3khbMmR0Tjhs2XCbTSHUbhqb5exnvtR+I+X2kJBdcuwISohx vQVkKQW3CpBjybw4L/VoshU8w3+M66AD3Kn8wfRo8Q== 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-stable] [dpdk-dev] [PATCH] eal/option: fix option register duplicate detection X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches 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