summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-10-14 12:05:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-30 16:53:24 +0200
commit76281a16fbd01adaf823849a9e5ab30b3024ec5c (patch)
treedcc2e44b19d2d3b4cbc4ed8db2e393caf424d73f /lib
parent3e503822c7379ffc1a1c60aed57eb81954451faa (diff)
downloadbarebox-76281a16fbd01adaf823849a9e5ab30b3024ec5c.tar.gz
barebox-76281a16fbd01adaf823849a9e5ab30b3024ec5c.tar.xz
introduce strtoull_suffix function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/misc.c14
-rw-r--r--lib/vsprintf.c1
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 549b9601c9..cdf01857a1 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -27,15 +27,15 @@
#include <linux/ctype.h>
/*
- * Like simple_strtoul() but handles an optional G, M, K or k
+ * Like simple_strtoull() but handles an optional G, M, K or k
* suffix for Gigabyte, Megabyte or Kilobyte
*/
-unsigned long strtoul_suffix(const char *str, char **endp, int base)
+unsigned long long strtoull_suffix(const char *str, char **endp, int base)
{
- unsigned long val;
+ unsigned long long val;
char *end;
- val = simple_strtoul(str, &end, base);
+ val = simple_strtoull(str, &end, base);
switch (*end) {
case 'G':
@@ -55,6 +55,12 @@ unsigned long strtoul_suffix(const char *str, char **endp, int base)
return val;
}
+EXPORT_SYMBOL(strtoull_suffix);
+
+unsigned long strtoul_suffix(const char *str, char **endp, int base)
+{
+ return strtoull_suffix(str, endp, base);
+}
EXPORT_SYMBOL(strtoul_suffix);
/*
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 9763515130..17c197334a 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -83,6 +83,7 @@ unsigned long long simple_strtoull (const char *cp, char **endp, unsigned int ba
*endp = (char *) cp;
return result;
}
+EXPORT_SYMBOL(simple_strtoll);
/* we use this so that we can do without the ctype library */
#define is_digit(c) ((c) >= '0' && (c) <= '9')