X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib%2Ftiny-printf.c;h=ebef92fc9f6b3c938bfd4abe7894483915b05768;hb=078e558699844bfe5b21a5c9730bba84144ef642;hp=0b04813dc206be9cd6163136574b7213e5933e91;hpb=bdf1ea11c8d8789bf95a284d6c980eafea13d94c;p=u-boot diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 0b04813dc2..ebef92fc9f 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: LGPL-2.1+ /* * Tiny printf version for SPL * @@ -5,8 +6,6 @@ * http://www.sparetimelabs.com/printfrevisited/printfrevisited.php * * Copyright (C) 2004,2008 Kustaa Nyholm - * - * SPDX-License-Identifier: LGPL-2.1+ */ #include @@ -23,11 +22,6 @@ struct printf_info { void (*putc)(struct printf_info *info, char ch); }; -static void putc_normal(struct printf_info *info, char ch) -{ - putc(ch); -} - static void out(struct printf_info *info, char c) { *info->bf++ = c; @@ -321,6 +315,12 @@ abort: return 0; } +#if CONFIG_IS_ENABLED(PRINTF) +static void putc_normal(struct printf_info *info, char ch) +{ + putc(ch); +} + int vprintf(const char *fmt, va_list va) { struct printf_info info; @@ -343,6 +343,7 @@ int printf(const char *fmt, ...) return ret; } +#endif static void putc_outstr(struct printf_info *info, char ch) { @@ -381,12 +382,3 @@ int snprintf(char *buf, size_t size, const char *fmt, ...) return ret; } - -void __assert_fail(const char *assertion, const char *file, unsigned line, - const char *function) -{ - /* This will not return */ - printf("%s:%u: %s: Assertion `%s' failed.", file, line, function, - assertion); - hang(); -}