diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 09:03:29 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:14 -0400 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/mii.c | |
parent | 031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff) |
global: Convert simple_strtoul() with hex to hextoul()
It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.
Add a proper comment to simple_strtoul() while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/mii.c')
-rw-r--r-- | cmd/mii.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -267,10 +267,10 @@ static void extract_range( unsigned char * phi) { char * end; - *plo = simple_strtoul(input, &end, 16); + *plo = hextoul(input, &end); if (*end == '-') { end++; - *phi = simple_strtoul(end, NULL, 16); + *phi = hextoul(end, NULL); } else { *phi = *plo; @@ -319,9 +319,9 @@ static int do_mii(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc >= 4) extract_range(argv[3], ®lo, ®hi); if (argc >= 5) - data = simple_strtoul(argv[4], NULL, 16); + data = hextoul(argv[4], NULL); if (argc >= 6) - mask = simple_strtoul(argv[5], NULL, 16); + mask = hextoul(argv[5], NULL); } if (addrhi > 31 && strncmp(op, "de", 2)) { |