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

Dmitry Rokosov ddrokosov at salutedevices.com
Thu Oct 17 16:12:09 CEST 2024


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.

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
Tested-by: Guillaume La Roque <glaroque at baylibre.com>
Signed-off-by: Dmitry Rokosov <ddrokosov at salutedevices.com>
---
 cmd/bcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/bcb.c b/cmd/bcb.c
index 2854408e5669b0d7d2a06073fa81158b21834b99..b33c046af0385a112fd40634ab7f48e05542ca48 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -391,7 +391,7 @@ __maybe_unused static int do_bcb_ab_select(struct cmd_tbl *cmdtp,
 		return CMD_RET_USAGE;
 
 	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