From: Simon Glass Date: Mon, 21 Oct 2019 23:26:43 +0000 (-0600) Subject: tiny-printf: Reduce size by removing ctype X-Git-Tag: v2020.01-rc2~27^2~12 X-Git-Url: https://git.librecmc.org/?p=oweals%2Fu-boot.git;a=commitdiff_plain;h=1c1c8a3a990742a73a75b091c35213b0a50f0c45 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 --- 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, '%');