summaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-06-20 17:14:14 +0200
committerWolfgang Denk <wd@denx.de>2010-07-04 23:51:49 +0200
commitd9c27253ce333e2086b2d758b42dc3ecb8b34c3d (patch)
tree259c764843e1109f07f3f82e4b6c34a8d1772775 /common/console.c
parentc0c15379e22b1006806c9219934415b84e8d338a (diff)
downloadu-boot-imx-d9c27253ce333e2086b2d758b42dc3ecb8b34c3d.zip
u-boot-imx-d9c27253ce333e2086b2d758b42dc3ecb8b34c3d.tar.gz
u-boot-imx-d9c27253ce333e2086b2d758b42dc3ecb8b34c3d.tar.bz2
Make *printf() return "int" instead of "void"
Change the return type of the *printf() functions to the standard "int"; no changes are needed but returning the already available length count. This will save a few additional strlen() calls later... Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/common/console.c b/common/console.c
index b09b7d1..7e01886 100644
--- a/common/console.c
+++ b/common/console.c
@@ -201,7 +201,7 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
/** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
-void serial_printf(const char *fmt, ...)
+int serial_printf(const char *fmt, ...)
{
va_list args;
uint i;
@@ -216,6 +216,7 @@ void serial_printf(const char *fmt, ...)
va_end(args);
serial_puts(printbuffer);
+ return i;
}
int fgetc(int file)
@@ -269,7 +270,7 @@ void fputs(int file, const char *s)
console_puts(file, s);
}
-void fprintf(int file, const char *fmt, ...)
+int fprintf(int file, const char *fmt, ...)
{
va_list args;
uint i;
@@ -285,6 +286,7 @@ void fprintf(int file, const char *fmt, ...)
/* Send to desired file */
fputs(file, printbuffer);
+ return i;
}
/** U-Boot INITIAL CONSOLE-COMPATIBLE FUNCTION *****************************/
@@ -363,7 +365,7 @@ void puts(const char *s)
}
}
-void printf(const char *fmt, ...)
+int printf(const char *fmt, ...)
{
va_list args;
uint i;
@@ -379,9 +381,10 @@ void printf(const char *fmt, ...)
/* Print the string */
puts(printbuffer);
+ return i;
}
-void vprintf(const char *fmt, va_list args)
+int vprintf(const char *fmt, va_list args)
{
uint i;
char printbuffer[CONFIG_SYS_PBSIZE];
@@ -393,6 +396,7 @@ void vprintf(const char *fmt, va_list args)
/* Print the string */
puts(printbuffer);
+ return i;
}
/* test if ctrl-c was pressed */