diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 18:03:30 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 20:32:14 +0300 |
commit | 0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch) | |
tree | 2d83815e93fc16decbaa5671fd660ade0ec74532 /board/cavium/thunderx | |
parent | 7e5f460ec457fe310156e399198a41eb0ce1e98c (diff) | |
download | u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.xz |
global: Convert simple_strtoul() with decimal to dectoul()
It is a pain to have to specify the value 10 in each call. Add a new
dectoul() function and update the code to use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/cavium/thunderx')
-rw-r--r-- | board/cavium/thunderx/atf.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/board/cavium/thunderx/atf.c b/board/cavium/thunderx/atf.c index 582af6f1f1..1a039c53c1 100644 --- a/board/cavium/thunderx/atf.c +++ b/board/cavium/thunderx/atf.c @@ -236,47 +236,47 @@ int do_atf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if ((argc == 5) && !strcmp(argv[1], "readmmc")) { buffer = (void *)hextoul(argv[2], NULL); - offset = simple_strtoul(argv[3], NULL, 10); - size = simple_strtoul(argv[4], NULL, 10); + offset = dectoul(argv[3], NULL); + size = dectoul(argv[4], NULL); ret = atf_read_mmc(offset, buffer, size); } else if ((argc == 5) && !strcmp(argv[1], "readnor")) { buffer = (void *)hextoul(argv[2], NULL); - offset = simple_strtoul(argv[3], NULL, 10); - size = simple_strtoul(argv[4], NULL, 10); + offset = dectoul(argv[3], NULL); + size = dectoul(argv[4], NULL); ret = atf_read_nor(offset, buffer, size); } else if ((argc == 5) && !strcmp(argv[1], "writemmc")) { buffer = (void *)hextoul(argv[2], NULL); - offset = simple_strtoul(argv[3], NULL, 10); - size = simple_strtoul(argv[4], NULL, 10); + offset = dectoul(argv[3], NULL); + size = dectoul(argv[4], NULL); ret = atf_write_mmc(offset, buffer, size); } else if ((argc == 5) && !strcmp(argv[1], "writenor")) { buffer = (void *)hextoul(argv[2], NULL); - offset = simple_strtoul(argv[3], NULL, 10); - size = simple_strtoul(argv[4], NULL, 10); + offset = dectoul(argv[3], NULL); + size = dectoul(argv[4], NULL); ret = atf_write_nor(offset, buffer, size); } else if ((argc == 2) && !strcmp(argv[1], "part")) { atf_print_part_table(); } else if ((argc == 4) && !strcmp(argv[1], "erasenor")) { - offset = simple_strtoul(argv[2], NULL, 10); - size = simple_strtoul(argv[3], NULL, 10); + offset = dectoul(argv[2], NULL); + size = dectoul(argv[3], NULL); ret = atf_erase_nor(offset, size); } else if ((argc == 2) && !strcmp(argv[1], "envcount")) { ret = atf_env_count(); printf("Number of environment strings: %zd\n", ret); } else if ((argc == 3) && !strcmp(argv[1], "envstring")) { - index = simple_strtoul(argv[2], NULL, 10); + index = dectoul(argv[2], NULL); ret = atf_env_string(index, str); if (ret > 0) printf("Environment string %d: %s\n", index, str); else printf("Return code: %zd\n", ret); } else if ((argc == 3) && !strcmp(argv[1], "dramsize")) { - node = simple_strtoul(argv[2], NULL, 10); + node = dectoul(argv[2], NULL); ret = atf_dram_size(node); printf("DRAM size: %zd Mbytes\n", ret >> 20); } else if ((argc == 2) && !strcmp(argv[1], "nodes")) { |