From ab6dc1d2970b5835409091a60ddcf8e6cabefc25 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 7 Dec 2011 10:55:16 +0100 Subject: console_simple: Fix compilation Since fprintf and console_puts now return the number of character written the prototypes have changes. We forgot to fix console_simple which now fails to compile with: common/console_simple.c:48:6: error: conflicting types for 'fprintf' include/stdio.h:57:5: note: previous declaration of 'fprintf' was here common/console_simple.c:67:6: error: conflicting types for 'console_puts' include/stdio.h:20:5: note: previous declaration of 'console_puts' was here Fix this by returning the proper numbers of characters written. Signed-off-by: Sascha Hauer --- common/console_simple.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'common/console_simple.c') diff --git a/common/console_simple.c b/common/console_simple.c index 7304d8ee05..61a233d1b5 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -45,7 +45,7 @@ int vprintf (const char *fmt, va_list args) } EXPORT_SYMBOL(vprintf); -void fprintf (int file, const char *fmt, ...) +int fprintf(int file, const char *fmt, ...) { va_list args; uint i; @@ -61,18 +61,25 @@ void fprintf (int file, const char *fmt, ...) /* Print the string */ fputs(file, printbuffer); + + return i; } EXPORT_SYMBOL(fprintf); -void console_puts(unsigned int ch, const char *str) +int console_puts(unsigned int ch, const char *str) { const char *s = str; + int i = 0; + while (*s) { console_putc(ch, *s); if (*s == '\n') console_putc(ch, '\r'); s++; + i++; } + + return i; } EXPORT_SYMBOL(console_puts); -- cgit v1.2.3