summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-11-13 08:14:29 -0600
committerTom Rini <[email protected]>2024-11-13 08:14:29 -0600
commit9d49c73862c4c492b81b8cdd941fc4d602774673 (patch)
treec0e441278c859d2e65ebf46844714ff58349fc8f /include
parentb30787ad24d51ea7efb75870a83f2c3e6cad0f24 (diff)
parent37587d2e1454e9642bbae900b920dc5f0530fa87 (diff)
Merge patch series "lib: uuid: fix uuid_str_to_le_bin() on 32-bit"
Heinrich Schuchardt <[email protected]> says: The lib_test_uuid_to_le and lib lib_test_dynamic_uuid tests fail on 32-bit systems. But we never caught this in our CI because we never ran any of our C unit tests on 32-bit. Enable CONFIG_UNIT_TEST on qemu_arm_defconfig. hextoul() cannot convert a string to a 64-bit number on a 32-bit system. Use the new function hextoull() instead. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
-rw-r--r--include/vsprintf.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/vsprintf.h b/include/vsprintf.h
index fe951471426..9da6ce7cc4d 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -45,6 +45,19 @@ ulong simple_strtoul(const char *cp, char **endp, unsigned int base);
unsigned long hextoul(const char *cp, char **endp);
/**
+ * hex_strtoull - convert a string in hex to an unsigned long long
+ *
+ * @cp: The string to be converted
+ * @endp: Updated to point to the first character not converted
+ * Return: value decoded from string (0 if invalid)
+ *
+ * Converts a hex string to an unsigned long long. If there are invalid
+ * characters at the end these are ignored. In the worst case, if all characters
+ * are invalid, 0 is returned
+ */
+unsigned long long hextoull(const char *cp, char **endp);
+
+/**
* dec_strtoul - convert a string in decimal to an unsigned long
*
* @cp: The string to be converted