From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal/option: fix option register duplicate detection Date: Wed, 19 Dec 2018 23:59:35 +0100 Message-ID: <8444963.9kjRHCCdve@xps> References: <20181217092559.21801-1-gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, David Marchand , stable@dpdk.org To: Gaetan Rivet Return-path: In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 17/12/2018 11:19, David Marchand: > 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 > > --- > > 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; > > + } > > } > > Reviewed-by: David Marchand Applied, thanks > Different topic but having a return code would be better than a simple log. +1