diff options
| author | Tom Rini <[email protected]> | 2021-08-22 15:44:53 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-08-22 15:44:53 -0400 |
| commit | 3ee343cd7cc1eaa4e0b905ab3d8d0c764985d264 (patch) | |
| tree | 6c264e81a6783440d68f3666f9546299a10125b5 /lib | |
| parent | 79d389a54891a67269bfa366f044a2079409e499 (diff) | |
| parent | f52352f65e359c91f69faaa6f6cd1ea34f8adf6d (diff) | |
Merge branch '2021-08-21-assorted-changes'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/display_options.c | 7 | ||||
| -rw-r--r-- | lib/tiny-printf.c | 26 |
2 files changed, 19 insertions, 14 deletions
diff --git a/lib/display_options.c b/lib/display_options.c index c08a87e3162..4da1f5244f3 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -107,7 +107,12 @@ void print_size(uint64_t size, const char *s) } if (!c) { - printf("%llu Bytes%s", size, s); + /* + * SPL tiny-printf is not capable for printing uint64_t. + * We have just checked that the size is small enought to fit + * unsigned int safely. + */ + printf("%u Bytes%s", (unsigned int)size, s); return; } diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 8fc7e48d994..89aaa854771 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -9,8 +9,9 @@ */ #include <common.h> -#include <stdarg.h> +#include <log.h> #include <serial.h> +#include <stdarg.h> #include <linux/ctype.h> struct printf_info { @@ -269,20 +270,19 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va) } break; case 'p': -#ifdef DEBUG - 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 - */ - while (isalnum(fmt[0])) - fmt++; - break; -#else + if (CONFIG_IS_ENABLED(NET_SUPPORT) || _DEBUG) { + 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 + */ + while (isalnum(fmt[0])) + fmt++; + break; + } islong = true; /* no break */ -#endif case 'x': if (islong) { num = va_arg(va, unsigned long); |
