Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F271C4707F for ; Thu, 27 May 2021 23:24:29 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA00F61090 for ; Thu, 27 May 2021 23:24:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA00F61090 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9C2582D14; Fri, 28 May 2021 01:24:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Iz6dkg0a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B01E682D4B; Fri, 28 May 2021 01:24:24 +0200 (CEST) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B6C8982A8D for ; Fri, 28 May 2021 01:24:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x82e.google.com with SMTP id v4so1525401qtp.1 for ; Thu, 27 May 2021 16:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RzXoRsD8kbvlgxnxa9iJUJ9zfXwS7/ehfHsx3OWfYcc=; b=Iz6dkg0akWwMS2alXv8qryKMQr/ZYal2MLy+OjX3YhqzKOssY0jAQupdPvvn6Jjk8w 4eH1z6Vl92/YmCyGem1o32MfBn9NjFSxQJoltMKA6npJkBOUaSXIVUfTjTmEV60B3L4K eYAH95COioR8hAyLP8R2lt4524/0J5sH9EjKEU1PNhN0GGaDHmV8yCqGA1i+WkoFdCQe iWan/NESzrJLStJapx2di6Njzj5uuBIlpjjVHzBNzAQJpbbGhFQuVelhe+sl1/UMlPoT HDPQ5lyAhsIG99dp96y5TGttFvfy38KuPRTy3J2N2Fwo5AtGe82huTXzc1Mp6PdD++Dq aQLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RzXoRsD8kbvlgxnxa9iJUJ9zfXwS7/ehfHsx3OWfYcc=; b=ETHINnNE2icmTzrLacRjOCmnfwPBc9Z2zQ6EH7D8CK1JlmAiiEpfGhhs8RiA5aGISa S/6lWshhh9nRvclHgccgIutBvXiHnseffOx8yaP9RMe8E+J0mzpaRRFRMIiyfqUq1d5d x9P15Q1mOO3f6QQzwZXEQqnQQqzKoFNvkz1FMG16BSRfjAqxo/DGTsWCXB82iJgXA6f9 AL6eT4grjng1Yt6AkCPRjNMXcHVU8ZnQE+QvTd/oWTB5bpAFxe/iPj7+SUoZDNSEBqdg 8h5Zhlpmo/Q4ounLJL2FzdJ71laP8Q6TcKjfFL9Xe6GVVZiYuvE57tUjI3w2TWFZCQkB KIpw== X-Gm-Message-State: AOAM531gj+mxAFwooubRXCiRfoppADwvX+//Q5HFNGJDXZlYLuLkFAgX rGT+w4yL58tNvxap6YPC/8w= X-Google-Smtp-Source: ABdhPJwrEP7NN9x4G27RTMrAtyPYtODg9tvMZxzCSjzrt6Y4KvO6IYjJA04+rsllRbmEygCqFB3rvw== X-Received: by 2002:a05:622a:28f:: with SMTP id z15mr968316qtw.260.1622157860527; Thu, 27 May 2021 16:24:20 -0700 (PDT) Received: from [192.168.1.201] (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.googlemail.com with ESMTPSA id e19sm2308331qtr.45.2021.05.27.16.24.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 May 2021 16:24:20 -0700 (PDT) Subject: Re: [PATCH] common: The do_repeat flag interferes with commands issued via run_command API To: Farhan Ali , u-boot@lists.denx.de Cc: Simon Glass , Rasmus Villemoes , "peng.wang@smartm.com" , Patrick Delaunay References: <20210527212404.38250-1-farhan.ali@broadcom.com> From: Sean Anderson Message-ID: <24f61522-b53a-0d80-ed74-71ad8e68b75e@gmail.com> Date: Thu, 27 May 2021 19:24:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210527212404.38250-1-farhan.ali@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean > Re: [PATCH] common: The do_repeat flag interferes with commands issued via run_command API The tag here should be "hush: ..." The subject should be an action, such as "Clear do_repeat flag after running commands". On 5/27/21 5:24 PM, Farhan Ali wrote: > Must clear the do_repeat flag once it is consumed. What is "it" here? Please add a few more sentences describing why you want to change this. For example, you could note that do_repeat is a file-level variable which is used by get_user_input to signal when a command should be repeated. Though, I wonder why we don't set the flags in the first place... > > Signed-off-by: Farhan Ali > Cc: Simon Glass > Cc: Sean Anderson > Cc: Rasmus Villemoes > Cc: Farhan Ali > Cc: "peng.wang@smartm.com" > Cc: Patrick Delaunay > > --- > common/cli_hush.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/common/cli_hush.c b/common/cli_hush.c > index 1467ff81b3..1c9adf5683 100644 > --- a/common/cli_hush.c > +++ b/common/cli_hush.c > @@ -1559,6 +1559,11 @@ static int run_pipe_real(struct pipe *pi) > # endif > #endif /* __U_BOOT__ */ > > + /* Clear do_repeat after consumption, avoids conflicts Multi-line comments should start with a blank line. > + * with cmds issued via run_command API > + */ > + do_repeat = 0; > + Can you add a test case for this? --Sean > nextin = 0; > #ifndef __U_BOOT__ > pi->pgrp = -1; >