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 /cmd/mmc.c | |
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 'cmd/mmc.c')
-rw-r--r-- | cmd/mmc.c | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -519,10 +519,10 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, if (argc == 1) { dev = curr_device; } else if (argc == 2) { - dev = simple_strtoul(argv[1], NULL, 10); + dev = dectoul(argv[1], NULL); } else if (argc == 3) { - dev = (int)simple_strtoul(argv[1], NULL, 10); - part = (int)simple_strtoul(argv[2], NULL, 10); + dev = (int)dectoul(argv[1], NULL); + part = (int)dectoul(argv[2], NULL); if (part > PART_ACCESS_MASK) { printf("#part_num shouldn't be larger than %d\n", PART_ACCESS_MASK); @@ -572,9 +572,9 @@ static int parse_hwpart_user(struct mmc_hwpart_conf *pconf, if (i + 2 >= argc) return -1; pconf->user.enh_start = - simple_strtoul(argv[i+1], NULL, 10); + dectoul(argv[i + 1], NULL); pconf->user.enh_size = - simple_strtoul(argv[i+2], NULL, 10); + dectoul(argv[i + 2], NULL); i += 3; } else if (!strcmp(argv[i], "wrrel")) { if (i + 1 >= argc) @@ -603,7 +603,7 @@ static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx, if (1 >= argc) return -1; - pconf->gp_part[pidx].size = simple_strtoul(argv[0], NULL, 10); + pconf->gp_part[pidx].size = dectoul(argv[0], NULL); i = 1; while (i < argc) { @@ -721,10 +721,10 @@ static int do_mmc_bootbus(struct cmd_tbl *cmdtp, int flag, if (argc != 5) return CMD_RET_USAGE; - dev = simple_strtoul(argv[1], NULL, 10); - width = simple_strtoul(argv[2], NULL, 10); - reset = simple_strtoul(argv[3], NULL, 10); - mode = simple_strtoul(argv[4], NULL, 10); + dev = dectoul(argv[1], NULL); + width = dectoul(argv[2], NULL); + reset = dectoul(argv[3], NULL); + mode = dectoul(argv[4], NULL); mmc = init_mmc_device(dev, false); if (!mmc) @@ -785,9 +785,9 @@ static int do_mmc_boot_resize(struct cmd_tbl *cmdtp, int flag, if (argc != 4) return CMD_RET_USAGE; - dev = simple_strtoul(argv[1], NULL, 10); - bootsize = simple_strtoul(argv[2], NULL, 10); - rpmbsize = simple_strtoul(argv[3], NULL, 10); + dev = dectoul(argv[1], NULL); + bootsize = dectoul(argv[2], NULL); + rpmbsize = dectoul(argv[3], NULL); mmc = init_mmc_device(dev, false); if (!mmc) @@ -842,7 +842,7 @@ static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag, if (argc != 2 && argc != 3 && argc != 5) return CMD_RET_USAGE; - dev = simple_strtoul(argv[1], NULL, 10); + dev = dectoul(argv[1], NULL); mmc = init_mmc_device(dev, false); if (!mmc) @@ -856,9 +856,9 @@ static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag, if (argc == 2 || argc == 3) return mmc_partconf_print(mmc, argc == 3 ? argv[2] : NULL); - ack = simple_strtoul(argv[2], NULL, 10); - part_num = simple_strtoul(argv[3], NULL, 10); - access = simple_strtoul(argv[4], NULL, 10); + ack = dectoul(argv[2], NULL); + part_num = dectoul(argv[3], NULL); + access = dectoul(argv[4], NULL); /* acknowledge to be sent during boot operation */ return mmc_set_part_conf(mmc, ack, part_num, access); @@ -879,8 +879,8 @@ static int do_mmc_rst_func(struct cmd_tbl *cmdtp, int flag, if (argc != 3) return CMD_RET_USAGE; - dev = simple_strtoul(argv[1], NULL, 10); - enable = simple_strtoul(argv[2], NULL, 10); + dev = dectoul(argv[1], NULL); + enable = dectoul(argv[2], NULL); if (enable > 2) { puts("Invalid RST_n_ENABLE value\n"); @@ -937,7 +937,7 @@ static int do_mmc_bkops_enable(struct cmd_tbl *cmdtp, int flag, if (argc != 2) return CMD_RET_USAGE; - dev = simple_strtoul(argv[1], NULL, 10); + dev = dectoul(argv[1], NULL); mmc = init_mmc_device(dev, false); if (!mmc) |