aboutsummaryrefslogtreecommitdiff
path: root/common/image.c
diff options
context:
space:
mode:
authorSimon Glass2021-07-24 09:03:29 -0600
committerTom Rini2021-08-02 13:32:14 -0400
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /common/image.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 'common/image.c')
-rw-r--r--common/image.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/image.c b/common/image.c
index 51854aae5dd..59c52a1f9ad 100644
--- a/common/image.c
+++ b/common/image.c
@@ -662,7 +662,7 @@ static int on_loadaddr(const char *name, const char *value, enum env_op op,
switch (op) {
case env_op_create:
case env_op_overwrite:
- image_load_addr = simple_strtoul(value, NULL, 16);
+ image_load_addr = hextoul(value, NULL);
break;
default:
break;
@@ -676,7 +676,7 @@ ulong env_get_bootm_low(void)
{
char *s = env_get("bootm_low");
if (s) {
- ulong tmp = simple_strtoul(s, NULL, 16);
+ ulong tmp = hextoul(s, NULL);
return tmp;
}
@@ -1060,7 +1060,7 @@ ulong genimg_get_kernel_addr_fit(char * const img_addr,
*fit_uname_kernel, kernel_addr);
#endif
} else {
- kernel_addr = simple_strtoul(img_addr, NULL, 16);
+ kernel_addr = hextoul(img_addr, NULL);
debug("* kernel: cmdline image address = 0x%08lx\n",
kernel_addr);
}
@@ -1227,7 +1227,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
} else
#endif
{
- rd_addr = simple_strtoul(select, NULL, 16);
+ rd_addr = hextoul(select, NULL);
debug("* ramdisk: cmdline image address = "
"0x%08lx\n",
rd_addr);
@@ -1301,7 +1301,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
if (select)
end = strchr(select, ':');
if (end) {
- rd_len = simple_strtoul(++end, NULL, 16);
+ rd_len = hextoul(++end, NULL);
rd_data = rd_addr;
} else
#endif
@@ -1379,7 +1379,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
/* a value of "no" or a similar string will act like 0,
* turning the "load high" feature off. This is intentional.
*/
- initrd_high = simple_strtoul(s, NULL, 16);
+ initrd_high = hextoul(s, NULL);
if (initrd_high == ~0)
initrd_copy_to_ram = 0;
} else {