From 03c2d1f9566c0bbbae6b7f1426cfb9635033f622 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Thu, 14 Jul 2011 16:30:57 +0530 Subject: [PATCH] lib/printf.c: making serial_printf return vsprintf ret value Making it work the same way as current u-boot head, and as a side effect also fixing build when -Werror=unused-but-set-variable is used: printf.c: In function 'serial_printf': printf.c:290:7: error: variable 'i' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors Signed-off-by: Ricardo Salveti de Araujo Signed-off-by: Anand Gadiyar --- include/common.h | 2 +- lib/printf.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/common.h b/include/common.h index ffaf582..a3c5092 100644 --- a/include/common.h +++ b/include/common.h @@ -98,7 +98,7 @@ int serial_getc (void); int serial_tstc (void); /* lib/printf.c */ -void serial_printf (const char *fmt, ...); +int serial_printf (const char *fmt, ...); #endif /* lib/crc.c */ diff --git a/lib/printf.c b/lib/printf.c index 91d22fc..b1dfe0b 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -284,7 +284,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args) return str-buf; } -void serial_printf (const char *fmt, ...) +int serial_printf (const char *fmt, ...) { va_list args; uint i; @@ -300,5 +300,6 @@ void serial_printf (const char *fmt, ...) /* Print the string */ serial_puts (printbuffer); + return i; } #endif -- 2.39.5