Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/kernel.h
Show First 20 Lines • Show All 460 Lines • ▼ Show 20 Lines | kstrtou64(const char *cp, unsigned int base, u64 *res) | ||||
if (*end == '\n') | if (*end == '\n') | ||||
end++; | end++; | ||||
if (*cp == 0 || *end != 0) | if (*cp == 0 || *end != 0) | ||||
return (-EINVAL); | return (-EINVAL); | ||||
return (0); | return (0); | ||||
} | } | ||||
static inline int | static inline int | ||||
kstrtoull(const char *cp, unsigned int base, unsigned long long *res) | |||||
{ | |||||
return (kstrtou64(cp, base, (u64 *)res)); | |||||
} | |||||
static inline int | |||||
kstrtobool(const char *s, bool *res) | kstrtobool(const char *s, bool *res) | ||||
{ | { | ||||
int len; | int len; | ||||
if (s == NULL || (len = strlen(s)) == 0 || res == NULL) | if (s == NULL || (len = strlen(s)) == 0 || res == NULL) | ||||
return (-EINVAL); | return (-EINVAL); | ||||
/* skip newline character, if any */ | /* skip newline character, if any */ | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |