summaryrefslogtreecommitdiff
path: root/common/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/hash.c')
-rw-r--r--common/hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/hash.c b/common/hash.c
index 059d381e23..dca23635ab 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -397,7 +397,7 @@ int hash_parse_string(const char *algo_name, const char *str, uint8_t *result)
char chr[3];
strlcpy(chr, &str[i * 2], 3);
- result[i] = simple_strtoul(chr, NULL, 16);
+ result[i] = hextoul(chr, NULL);
}
return 0;
@@ -470,7 +470,7 @@ static void store_result(struct hash_algo *algo, const uint8_t *sum,
ulong addr;
void *buf;
- addr = simple_strtoul(dest, NULL, 16);
+ addr = hextoul(dest, NULL);
buf = map_sysmem(addr, algo->digest_size);
memcpy(buf, sum, algo->digest_size);
unmap_sysmem(buf);
@@ -510,7 +510,7 @@ static int parse_verify_sum(struct hash_algo *algo, char *verify_str,
ulong addr;
void *buf;
- addr = simple_strtoul(verify_str, NULL, 16);
+ addr = hextoul(verify_str, NULL);
buf = map_sysmem(addr, algo->digest_size);
memcpy(vsum, buf, algo->digest_size);
} else {
@@ -555,8 +555,8 @@ int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp,
if ((argc < 2) || ((flags & HASH_FLAG_VERIFY) && (argc < 3)))
return CMD_RET_USAGE;
- addr = simple_strtoul(*argv++, NULL, 16);
- len = simple_strtoul(*argv++, NULL, 16);
+ addr = hextoul(*argv++, NULL);
+ len = hextoul(*argv++, NULL);
if (multi_hash()) {
struct hash_algo *algo;
@@ -628,7 +628,7 @@ int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp,
addr, addr + len - 1, crc);
if (argc >= 3) {
- ptr = (ulong *)simple_strtoul(argv[0], NULL, 16);
+ ptr = (ulong *)hextoul(argv[0], NULL);
*ptr = crc;
}
}