summaryrefslogtreecommitdiff
path: root/lib/uuid.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-08-02 13:32:20 -0400
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:20 -0400
commit51aef405550e603ff702c034f0e2cd0f15bdf2bb (patch)
tree15216d11d6890cd497b6a97176c7aad4c4d63ecf /lib/uuid.c
parent73994c452fc5a960114360a651201ac48b135e81 (diff)
parente6951139c0544116330b12e287fe45e30bbab11c (diff)
Merge branch '2021-08-02-numeric-input-cleanups'
- Merge in a series that cleans up and makes more consistent how we deal with numeric input on the CLI. This saves a few bytes in a lot of places.
Diffstat (limited to 'lib/uuid.c')
-rw-r--r--lib/uuid.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/uuid.c b/lib/uuid.c
index 5bc68674d02..67267c66a3c 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -164,26 +164,26 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin,
}
if (str_format == UUID_STR_FORMAT_STD) {
- tmp32 = cpu_to_be32(simple_strtoul(uuid_str, NULL, 16));
+ tmp32 = cpu_to_be32(hextoul(uuid_str, NULL));
memcpy(uuid_bin, &tmp32, 4);
- tmp16 = cpu_to_be16(simple_strtoul(uuid_str + 9, NULL, 16));
+ tmp16 = cpu_to_be16(hextoul(uuid_str + 9, NULL));
memcpy(uuid_bin + 4, &tmp16, 2);
- tmp16 = cpu_to_be16(simple_strtoul(uuid_str + 14, NULL, 16));
+ tmp16 = cpu_to_be16(hextoul(uuid_str + 14, NULL));
memcpy(uuid_bin + 6, &tmp16, 2);
} else {
- tmp32 = cpu_to_le32(simple_strtoul(uuid_str, NULL, 16));
+ tmp32 = cpu_to_le32(hextoul(uuid_str, NULL));
memcpy(uuid_bin, &tmp32, 4);
- tmp16 = cpu_to_le16(simple_strtoul(uuid_str + 9, NULL, 16));
+ tmp16 = cpu_to_le16(hextoul(uuid_str + 9, NULL));
memcpy(uuid_bin + 4, &tmp16, 2);
- tmp16 = cpu_to_le16(simple_strtoul(uuid_str + 14, NULL, 16));
+ tmp16 = cpu_to_le16(hextoul(uuid_str + 14, NULL));
memcpy(uuid_bin + 6, &tmp16, 2);
}
- tmp16 = cpu_to_be16(simple_strtoul(uuid_str + 19, NULL, 16));
+ tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL));
memcpy(uuid_bin + 8, &tmp16, 2);
tmp64 = cpu_to_be64(simple_strtoull(uuid_str + 24, NULL, 16));