svn commit: r361173 - stable/11/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Mon May 18 09:06:10 UTC 2020
Author: hselasky
Date: Mon May 18 09:06:09 2020
New Revision: 361173
URL: https://svnweb.freebsd.org/changeset/base/361173
Log:
MFC r360528:
Implement kstrtou64() in the LinuxKPI.
Submitted by: ashafer_badland.io (Austin Shafer)
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:05:29 2020 (r361172)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:06:09 2020 (r361173)
@@ -385,6 +385,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-stable-11
mailing list