[PATCH] common: The do_repeat flag interferes with commands issued via run_command API

Sean Anderson seanga2 at gmail.com
Fri May 28 01:24:19 CEST 2021


> 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 <farhan.ali at broadcom.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Sean Anderson <seanga2 at gmail.com>
> Cc: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> Cc: Farhan Ali <farhan.ali at broadcom.com>
> Cc: "peng.wang at smartm.com" <peng.wang at smartm.com>
> Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
> 
> ---
>   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;
> 



More information about the U-Boot mailing list