cmd_nand: slight optimization of nand_dump function
If a non-zero value is given to only_oob argument, printing the main area is skipped. With a little modification, we can skip the whole while loop. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit is contained in:

committed by
Scott Wood

parent
e40520b5b5
commit
7d25cd34e9
@@ -77,11 +77,12 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
|
|||||||
goto free_all;
|
goto free_all;
|
||||||
}
|
}
|
||||||
printf("Page %08lx dump:\n", off);
|
printf("Page %08lx dump:\n", off);
|
||||||
|
|
||||||
|
if (!only_oob) {
|
||||||
i = nand->writesize >> 4;
|
i = nand->writesize >> 4;
|
||||||
p = datbuf;
|
p = datbuf;
|
||||||
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
if (!only_oob)
|
|
||||||
printf("\t%02x %02x %02x %02x %02x %02x %02x %02x"
|
printf("\t%02x %02x %02x %02x %02x %02x %02x %02x"
|
||||||
" %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
" %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||||
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
|
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
|
||||||
@@ -89,6 +90,8 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
|
|||||||
p[15]);
|
p[15]);
|
||||||
p += 16;
|
p += 16;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
puts("OOB:\n");
|
puts("OOB:\n");
|
||||||
i = nand->oobsize >> 3;
|
i = nand->oobsize >> 3;
|
||||||
p = oobbuf;
|
p = oobbuf;
|
||||||
|
Reference in New Issue
Block a user