mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
CMD: random: fix return code
As of today 'random' command return 1 (CMD_RET_FAILURE) in case of successful execution and 0 (CMD_RET_SUCCESS) in case of bad arguments. Fix that. NOTE: we remove printing usage information from command body so it won't print twice. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
d16d37bcd4
commit
5f2c4e0129
1 changed files with 4 additions and 5 deletions
|
@ -1144,10 +1144,8 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
unsigned char *buf8;
|
unsigned char *buf8;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (argc < 3 || argc > 4) {
|
if (argc < 3 || argc > 4)
|
||||||
printf("usage: %s <addr> <len> [<seed>]\n", argv[0]);
|
return CMD_RET_USAGE;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = simple_strtoul(argv[2], NULL, 16);
|
len = simple_strtoul(argv[2], NULL, 16);
|
||||||
addr = simple_strtoul(argv[1], NULL, 16);
|
addr = simple_strtoul(argv[1], NULL, 16);
|
||||||
|
@ -1174,7 +1172,8 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
|
||||||
unmap_sysmem(start);
|
unmap_sysmem(start);
|
||||||
printf("%lu bytes filled with random data\n", len);
|
printf("%lu bytes filled with random data\n", len);
|
||||||
return 1;
|
|
||||||
|
return CMD_RET_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue