mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 04/10] introduce strtoull_suffix function
Date: Tue, 26 Jun 2012 21:54:57 +0200	[thread overview]
Message-ID: <1340740503-7003-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1340740503-7003-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/common.h |    1 +
 lib/misc.c       |   14 ++++++++++----
 lib/vsprintf.c   |    1 +
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/common.h b/include/common.h
index d2347f8..328aa30 100644
--- a/include/common.h
+++ b/include/common.h
@@ -142,6 +142,7 @@ int parse_area_spec(const char *str, ulong *start, ulong *size);
 
 /* Just like simple_strtoul(), but this one honors a K/M/G suffix */
 unsigned long strtoul_suffix(const char *str, char **endp, int base);
+unsigned long long strtoull_suffix(const char *str, char **endp, int base);
 
 void start_barebox(void);
 void shutdown_barebox(void);
diff --git a/lib/misc.c b/lib/misc.c
index 549b960..cdf0185 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 9763515..17c1973 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')
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-06-26 19:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 19:54 [PATCH] 64bit file support Sascha Hauer
2012-06-26 19:54 ` [PATCH 01/10] mtd: fix arguments to bad block ioctls Sascha Hauer
2012-06-26 19:54 ` [PATCH 02/10] nand-bb: bb->offset may become a 64bit type Sascha Hauer
2012-06-26 19:54 ` [PATCH 03/10] use loff_t for file offsets Sascha Hauer
2012-06-26 19:54 ` Sascha Hauer [this message]
2012-06-26 19:54 ` [PATCH 05/10] make parse_area_spec arguments loff_t Sascha Hauer
2012-06-26 19:54 ` [PATCH 06/10] make memory display 64bit capable Sascha Hauer
2012-06-26 19:55 ` [PATCH 07/10] make st_size in struct stat 64 bit Sascha Hauer
2012-06-26 19:55 ` [PATCH 08/10] make cdev 64bit capable Sascha Hauer
2012-06-26 19:55 ` [PATCH 09/10] memory commands: Make " Sascha Hauer
2012-06-26 19:55 ` [PATCH 10/10] partitions: " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340740503-7003-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox