diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2012-01-20 09:07:22 +0000 | 
|---|---|---|
| committer | Wolfgang Denk <wd@denx.de> | 2012-06-19 22:32:11 +0200 | 
| commit | feb12a1f6d4d9958ab019a3fa6a820244072c889 (patch) | |
| tree | 01a21fcff974feef288a023abf91818b2a62d627 /common/cmd_mem.c | |
| parent | 054ea170f271f869396eaea2ff14c52aa43d41c5 (diff) | |
| download | olio-uboot-2014.01-feb12a1f6d4d9958ab019a3fa6a820244072c889.tar.xz olio-uboot-2014.01-feb12a1f6d4d9958ab019a3fa6a820244072c889.zip | |
cmd_mem: cmp: convert while() to for() loop
Simplify the code slightly by using a for() loop since this is
basically what we're already doing -- incrementing "ngood" to
the value in "count".
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'common/cmd_mem.c')
| -rw-r--r-- | common/cmd_mem.c | 7 | 
1 files changed, 2 insertions, 5 deletions
| diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 7a199f51b..18f0a3f50 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -291,9 +291,7 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  	}  #endif -	ngood = 0; - -	while (count-- > 0) { +	for (ngood = 0; ngood < count; ++ngood) {  		ulong word1, word2;  		if (size == 4) {  			word1 = *(ulong *)addr1; @@ -313,12 +311,11 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  			break;  		} -		ngood++;  		addr1 += size;  		addr2 += size;  		/* reset watchdog from time to time */ -		if ((count % (64 << 10)) == 0) +		if ((ngood % (64 << 10)) == 0)  			WATCHDOG_RESET();  	} |