Patchwork [U-Boot] cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup

login
register
mail settings
Submitter Kumar Gala
Date Nov. 23, 2011, 7:48 p.m.
Message ID <1322077682-12838-1-git-send-email-galak@kernel.crashing.org>
Download mbox | patch
Permalink /patch/127371/
State Accepted
Commit 068f158fdf1937de45fc0e0bb2c3c9063c2cc8f6
Headers show

Comments

Kumar Gala - Nov. 23, 2011, 7:48 p.m.
cmd_nvedit.c: In function 'do_env_grep':
cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 common/cmd_nvedit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Mike Frysinger - Nov. 23, 2011, 10:18 p.m.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Igor Grinberg - Nov. 24, 2011, 7:33 a.m.
Hi Kumar,

Sorry for that one.

On 11/23/11 21:48, Kumar Gala wrote:
> cmd_nvedit.c: In function 'do_env_grep':
> cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
>  common/cmd_nvedit.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index 7409a36..5995354 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -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("=");
Wolfgang Denk - Nov. 27, 2011, 2:46 p.m.
Dear Kumar Gala,

In message <1322077682-12838-1-git-send-email-galak@kernel.crashing.org> you wrote:
> cmd_nvedit.c: In function 'do_env_grep':
> cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  common/cmd_nvedit.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 7409a36..5995354 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -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("=");