summaryrefslogtreecommitdiff
path: root/cmd/mii.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:29 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/mii.c
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/mii.c b/cmd/mii.c
index fe8602eb7c..fab420ee29 100644
--- a/cmd/mii.c
+++ b/cmd/mii.c
@@ -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], &reglo, &reghi);
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)) {