diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 18:03:29 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 20:32:14 +0300 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/net.c | |
parent | 031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff) | |
download | u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.xz |
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/net.c')
-rw-r--r-- | cmd/net.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -205,7 +205,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, /* pre-set image_load_addr */ s = env_get("loadaddr"); if (s != NULL) - image_load_addr = simple_strtoul(s, NULL, 16); + image_load_addr = hextoul(s, NULL); switch (argc) { case 1: @@ -220,7 +220,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, * form must be written in a format which can not be * mis-interpreted as a valid number. */ - addr = simple_strtoul(argv[1], &end, 16); + addr = hextoul(argv[1], &end); if (end == (argv[1] + strlen(argv[1]))) { image_load_addr = addr; /* refresh bootfile name from env */ @@ -234,7 +234,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, break; case 3: - image_load_addr = simple_strtoul(argv[1], NULL, 16); + image_load_addr = hextoul(argv[1], NULL); net_boot_file_name_explicit = true; copy_filename(net_boot_file_name, argv[2], sizeof(net_boot_file_name)); |