From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 874E47D52 for ; Fri, 8 Dec 2017 14:51:25 +0100 (CET) Received: from lfbn-1-6068-189.w90-110.abo.wanadoo.fr ([90.110.3.189] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eNJ9m-00069Z-Fj; Fri, 08 Dec 2017 14:57:40 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Fri, 08 Dec 2017 14:51:15 +0100 Date: Fri, 8 Dec 2017 14:51:15 +0100 From: Olivier MATZ To: Adrien Mazarguil Cc: Xueming Li , Wenzhuo Lu , dev@dpdk.org Message-ID: <20171208135114.wzkoidddxudbzyuy@platinum> References: <20171115155402.9967-1-xuemingl@mellanox.com> <20171208070244.24094-1-xuemingl@mellanox.com> <20171208122726.GT4062@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171208122726.GT4062@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1] lib/cmdline: init parse result memory 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: Fri, 08 Dec 2017 13:51:25 -0000 On Fri, Dec 08, 2017 at 01:27:26PM +0100, Adrien Mazarguil wrote: > On Fri, Dec 08, 2017 at 03:02:44PM +0800, Xueming Li wrote: > > Initialize binary result memory before parsing to avoid garbage in > > parsing result. > > > > Signed-off-by: Xueming Li > > Since you chose to move the break statement, maybe the original commit > mentioned in my previous message (9b3fbb051d2e "cmdline: fix parsing") can > be reverted afterward? I think it makes tmp_result redundant. > > Wenzhuo, as the author of that commit, can you confirm? > > Olivier, no problem with breaking the loop immediately after the first > successful match_inst() call instead of the last one? (I don't see why it > would be an issue but I may have missed something) Moving the break will change the behavior, it will never detect ambiguous commands (i.e when several commands match the same input). So I think we should not do it. IMO, only the memset() is enough. Regards, Olivier