svn commit: r361172 - stable/12/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Mon May 18 09:05:30 UTC 2020
Author: hselasky
Date: Mon May 18 09:05:29 2020
New Revision: 361172
URL: https://svnweb.freebsd.org/changeset/base/361172
Log:
MFC r360528:
Implement kstrtou64() in the LinuxKPI.
Submitted by: ashafer_badland.io (Austin Shafer)
Sponsored by: Mellanox Technologies
Modified:
stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:04:24 2020 (r361171)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:05:29 2020 (r361172)
@@ -390,6 +390,21 @@ kstrtou32(const char *cp, unsigned int base, u32 *res)
}
static inline int
+kstrtou64(const char *cp, unsigned int base, u64 *res)
+{
+ char *end;
+
+ *res = strtouq(cp, &end, base);
+
+ /* skip newline character, if any */
+ if (*end == '\n')
+ end++;
+ if (*cp == 0 || *end != 0)
+ return (-EINVAL);
+ return (0);
+}
+
+static inline int
kstrtobool(const char *s, bool *res)
{
int len;
More information about the svn-src-all
mailing list