From 7e5f460ec457fe310156e399198a41eb0ce1e98c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 24 Jul 2021 09:03:29 -0600 Subject: 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 --- cmd/tpm-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/tpm-common.c') diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c index 88c9e08e318d..a48c060273a6 100644 --- a/cmd/tpm-common.c +++ b/cmd/tpm-common.c @@ -68,7 +68,7 @@ void *parse_byte_string(char *bytes, u8 *data, size_t *count_ptr) for (i = 0; i < length; i += 2) { byte[0] = bytes[i]; byte[1] = bytes[i + 1]; - data[i / 2] = (u8)simple_strtoul(byte, NULL, 16); + data[i / 2] = (u8)hextoul(byte, NULL); } if (count_ptr) -- cgit v1.2.3