diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 945e063..b4d2f09 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -92,6 +92,7 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int); extern long simple_strtol(const char *,char **,unsigned int); extern unsigned long long simple_strtoull(const char *,char **,unsigned int); +extern long long simple_strtoll(const char *,char **,unsigned int); /* * min()/max()/clamp() macros that also do diff --git a/lib/strtox.c b/lib/strtox.c index cfe6124..08d912e 100644 --- a/lib/strtox.c +++ b/lib/strtox.c @@ -65,3 +65,12 @@ return result; } EXPORT_SYMBOL(simple_strtoull); + +long long simple_strtoll(const char *cp, char **endp, unsigned int base) +{ + if (*cp == '-') + return -simple_strtoull(cp + 1, endp, base); + + return simple_strtoull(cp, endp, base); +} +EXPORT_SYMBOL(simple_strtoll);