summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/console.c3
-rw-r--r--common/console_simple.c11
2 files changed, 10 insertions, 4 deletions
diff --git a/common/console.c b/common/console.c
index 219148d097..cab8689252 100644
--- a/common/console.c
+++ b/common/console.c
@@ -347,7 +347,6 @@ EXPORT_SYMBOL(console_flush);
int fprintf(int file, const char *fmt, ...)
{
va_list args;
- uint i;
char printbuffer[CFG_PBSIZE];
va_start (args, fmt);
@@ -355,7 +354,7 @@ int fprintf(int file, const char *fmt, ...)
/* For this to work, printbuffer must be larger than
* anything we ever want to print.
*/
- i = vsprintf (printbuffer, fmt, args);
+ vsprintf (printbuffer, fmt, args);
va_end (args);
/* Print the string */
diff --git a/common/console_simple.c b/common/console_simple.c
index 7e0619db02..73e4752cd8 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);