[U-Boot] [PATCH 2/7] common: avb_verify: Fix invalid 'for' loop condition

Eugeniu Rosca roscaeugeniu at gmail.com
Tue Aug 14 00:43:04 UTC 2018


Fix below compiler [1] warning:

common/avb_verify.c: In function ‘avb_find_dm_args’:
common/avb_verify.c:179:30: warning: left-hand operand of comma expression has no effect [-Wunused-value]
  for (i = 0; i < AVB_MAX_ARGS, args[i]; ++i) {

[1] aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11)

Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
---
 common/avb_verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/avb_verify.c b/common/avb_verify.c
index 20e35ade3029..e6f3f207ff6f 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -176,7 +176,7 @@ static int avb_find_dm_args(char **args, char *str)
 	if (!str)
 		return -1;
 
-	for (i = 0; i < AVB_MAX_ARGS, args[i]; ++i) {
+	for (i = 0; i < AVB_MAX_ARGS && args[i]; ++i) {
 		if (strstr(args[i], str))
 			return i;
 	}
-- 
2.18.0



More information about the U-Boot mailing list