summaryrefslogtreecommitdiff
path: root/cmd/net.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 18:03:29 +0300
committerTom Rini <trini@konsulko.com>2021-08-02 20:32:14 +0300
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/net.c
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff)
downloadu-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/net.c b/cmd/net.c
index 76c7e75125..651c1411f4 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -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));