mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
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>
This commit is contained in:
parent
054ea170f2
commit
feb12a1f6d
@ -291,9 +291,7 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ngood = 0;
|
for (ngood = 0; ngood < count; ++ngood) {
|
||||||
|
|
||||||
while (count-- > 0) {
|
|
||||||
ulong word1, word2;
|
ulong word1, word2;
|
||||||
if (size == 4) {
|
if (size == 4) {
|
||||||
word1 = *(ulong *)addr1;
|
word1 = *(ulong *)addr1;
|
||||||
@ -313,12 +311,11 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngood++;
|
|
||||||
addr1 += size;
|
addr1 += size;
|
||||||
addr2 += size;
|
addr2 += size;
|
||||||
|
|
||||||
/* reset watchdog from time to time */
|
/* reset watchdog from time to time */
|
||||||
if ((count % (64 << 10)) == 0)
|
if ((ngood % (64 << 10)) == 0)
|
||||||
WATCHDOG_RESET();
|
WATCHDOG_RESET();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user