[PATCH v2 3/6] cmd: bcb: change strcmp() usage style in the do_bcb_ab_select()

Mattijs Korpershoek mkorpershoek at baylibre.com
Mon Sep 30 17:48:30 CEST 2024


Hi Dmitry,

Thank you for the patch.

On jeu., sept. 12, 2024 at 00:49, Dmitry Rokosov <ddrokosov at salutedevices.com> wrote:

> In the entire cmd/bcb.c file, the return value of strcmp() is not
> directly compared to 0. Therefore, it would be better to maintain this
> style in the new do_bcb_ab_select() function as well.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov at salutedevices.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

> ---
>  cmd/bcb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/bcb.c b/cmd/bcb.c
> index a56535a743c0..a888549eed3a 100644
> --- a/cmd/bcb.c
> +++ b/cmd/bcb.c
> @@ -432,7 +432,7 @@ static int do_bcb_ab_select(struct cmd_tbl *cmdtp, int flag, int argc,
>  	bool dec_tries = true;
>  
>  	for (int i = 4; i < argc; i++) {
> -		if (strcmp(argv[i], "--no-dec") == 0)
> +		if (!strcmp(argv[i], "--no-dec"))
>  			dec_tries = false;
>  		else
>  			return CMD_RET_USAGE;
> -- 
> 2.43.0


More information about the U-Boot mailing list