Skip to contentSkip to conversation

cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup

PATCH New Kumar Gala 4 participants 4 messages Nov 23, 2011 – Nov 27, 2011

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup

cmd_nvedit.c: In function 'do_env_grep':
cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value

---
 common/cmd_nvedit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_nvedit.c +1 -1
index 7409a36..5995354 100644
@@ -179,7 +179,7 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
 
 	while (arg <= argc) {
 		idx = 0;
-		while (idx = hstrstr_r(argv[arg], idx, &match, &env_htab)) {
+		while ((idx = hstrstr_r(argv[arg], idx, &match, &env_htab))) {
 			if (!(matched[idx / 8] & (1 << (idx & 7)))) {
 				puts(match->key);
 				puts("=");
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH 1/1 cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup

In reply to Kumar Gala

Hi Kumar,

Sorry for that one.

Quoted 4 lines · Kumar Gala

cmd_nvedit.c: In function 'do_env_grep':
cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value

Quoted 17 lines
---
 common/cmd_nvedit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_nvedit.c +1 -1
index 7409a36..5995354 100644
@@ -179,7 +179,7 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
 
 	while (arg <= argc) {
 		idx = 0;
-		while (idx = hstrstr_r(argv[arg], idx, &match, &env_htab)) {
+		while ((idx = hstrstr_r(argv[arg], idx, &match, &env_htab))) {
 			if (!(matched[idx / 8] & (1 << (idx & 7)))) {
 				puts(match->key);
 				puts("=");
Signature · 2 lines
Regards,
Igor.
#3 lore raw

PATCH 1/1 cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 7 lines · In message <[email protected]> you…

cmd_nvedit.c: In function 'do_env_grep':
cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value

---
 common/cmd_nvedit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If some day we are defeated, well, war has  its  fortunes,  good  and
bad.
	-- Commander Kor, "Errand of Mercy", stardate 3201.7