From: Simon Glass Date: Mon, 14 Oct 2019 16:00:07 -0600 Subject: [U-Boot] [PATCH 1/9] tiny-printf: Reduce size by removing ctype In-Reply-To: <20191014220015.177359-1-sjg@chromium.org> References: <20191014220015.177359-1-sjg@chromium.org> Message-ID: <20191014220015.177359-2-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- lib/tiny-printf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index ebef92fc9f6..632b4249142 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, '%'); -- 2.23.0.700.g56cf767bdb-goog