summaryrefslogtreecommitdiff
path: root/cmd/flash.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:30 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /cmd/flash.c
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
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/flash.c')
-rw-r--r--cmd/flash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/flash.c b/cmd/flash.c
index bc93e984bc..819febc10e 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -57,7 +57,7 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
return 0;
*p++ = '\0';
- bank = simple_strtoul (str, &ep, 10);
+ bank = dectoul(str, &ep);
if (ep == str || *ep != '\0' ||
bank < 1 || bank > CONFIG_SYS_MAX_FLASH_BANKS ||
(fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN)
@@ -67,12 +67,12 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
if ((p = strchr (str, '-')) != NULL)
*p++ = '\0';
- first = simple_strtoul (str, &ep, 10);
+ first = dectoul(str, &ep);
if (ep == str || *ep != '\0' || first >= fp->sector_count)
return -1;
if (p != NULL) {
- last = simple_strtoul (p, &ep, 10);
+ last = dectoul(p, &ep);
if (ep == p || *ep != '\0' ||
last < first || last >= fp->sector_count)
return -1;