summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-22 02:26:43 +0300
committerSimon Glass <sjg@chromium.org>2019-10-27 19:56:41 +0300
commit1c1c8a3a990742a73a75b091c35213b0a50f0c45 (patch)
tree9f538a034831025f1bf06816d2708e15e9913668 /lib
parent2333dc47b891d169f97b57b0f687a5843acc7d8c (diff)
downloadu-boot-1c1c8a3a990742a73a75b091c35213b0a50f0c45.tar.xz
tiny-printf: Reduce size by removing ctype
The ctype array is brought into the image, adding 256 bytes, when it is unlikely to be needed. The extra code for %p is only present when DEBUG is defined, so let's drop ctype as well unless DEBUG is defined. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tiny-printf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index ebef92fc9f..632b424914 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -289,8 +289,15 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
break;
case 'p':
pointer(info, fmt, va_arg(va, void *));
+ /*
+ * Skip this because it pulls in _ctype which is
+ * 256 bytes, and we don't generally implement
+ * pointer anyway
+ */
+#ifdef DEBUG
while (isalnum(fmt[0]))
fmt++;
+#endif
break;
case '%':
out(info, '%');