diff mbox

lib/printf.c: making serial_printf return vsprintf ret value

Message ID 1310371702-28848-1-git-send-email-ricardo.salveti@linaro.org
State Accepted
Commit 03c2d1f9566c0bbbae6b7f1426cfb9635033f622
Headers show

Commit Message

Ricardo Salveti July 11, 2011, 8:08 a.m. UTC
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 <ricardo.salveti@linaro.org>
---
 include/common.h |    2 +-
 lib/printf.c     |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Gadiyar, Anand July 14, 2011, 11:01 a.m. UTC | #1
Ricardo Salveti de Araujo wrote:
> 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 <ricardo.salveti@linaro.org>

Applied, thanks.
Koen Kooi July 14, 2011, 11:17 a.m. UTC | #2
there a few more pending patches, can those go in as well?

Op 14 jul. 2011 om 13:01 heeft "Gadiyar, Anand" <gadiyar@ti.com> het volgende geschreven:

> Ricardo Salveti de Araujo wrote:
>> 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 <ricardo.salveti@linaro.org>
> 
> Applied, thanks.
> 
> -- 
> --
> To unsubscribe from this group, email: x-loader+unsubscribe@googlegroups.com
> For more options: http://groups.google.com/group/x-loader?hl=en?hl=en
> Home Page: http://gitorious.org/x-loader
Gadiyar, Anand July 14, 2011, 11:45 a.m. UTC | #3
Koen Kooi wrote:
> there a few more pending patches, can those go in as well?

I'm on it.

Sorry for the delay - I've been out of office a really long time,
and I no longer have a decent internet connection at my new home
(curses Airtel and Bangalore govt bureaucrats).

- Anand
diff mbox

Patch

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