From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v1] lib/cmdline: init parse result memory Date: Fri, 8 Dec 2017 14:51:15 +0100 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 Cc: Xueming Li , Wenzhuo Lu , dev@dpdk.org To: Adrien Mazarguil 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) Content-Disposition: inline In-Reply-To: <20171208122726.GT4062@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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