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

12 views
Skip to first unread message

Ricardo Salveti de Araujo

unread,
Jul 11, 2011, 4:08:22 AM7/11/11
to x-lo...@googlegroups.com, pat...@linaro.org, Ricardo Salveti de Araujo
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...@linaro.org>
---
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
--
1.7.4.1

Gadiyar, Anand

unread,
Jul 14, 2011, 7:01:40 AM7/14/11
to x-lo...@googlegroups.com, pat...@linaro.org
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...@linaro.org>

Applied, thanks.

Koen Kooi

unread,
Jul 14, 2011, 7:17:58 AM7/14/11
to x-lo...@googlegroups.com, x-lo...@googlegroups.com, pat...@linaro.org
there a few more pending patches, can those go in as well?

> --
> --
> To unsubscribe from this group, email: x-loader+u...@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

unread,
Jul 14, 2011, 7:45:33 AM7/14/11
to x-lo...@googlegroups.com, pat...@linaro.org
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

Gadiyar, Anand

unread,
Jul 14, 2011, 7:57:57 AM7/14/11
to x-lo...@googlegroups.com
Koen Kooi wrote:
> Just checking if you were doing LIFO or FIFO :)
>

Well, first I took the top two from my mailbox which I had an
incentive to use on my own board, but I had completely forgotten
about the 2 RFC series from Enric - I'm trying those out now.

Do you know any others I might be missing?

- Anand

Koen Kooi

unread,
Jul 14, 2011, 8:27:30 AM7/14/11
to x-lo...@googlegroups.com, Joel A Fernandes

Koen Kooi

unread,
Jul 14, 2011, 7:55:33 AM7/14/11
to x-lo...@googlegroups.com

Op 14 jul 2011, om 13:45 heeft Gadiyar, Anand het volgende geschreven:

Just checking if you were doing LIFO or FIFO :)

Gadiyar, Anand

unread,
Jul 15, 2011, 12:37:45 AM7/15/11
to x-lo...@googlegroups.com, Joel A Fernandes

It's not in the list archives, so I'm not sure if this was sent to
the x-loader mailing list.

I'll pick it up and merge it later today.

- Anand

Gadiyar, Anand

unread,
Jul 15, 2011, 2:08:39 AM7/15/11
to x-lo...@googlegroups.com, Joel A Fernandes
Gadiyar, Anand wrote:

> Koen Kooi wrote:
> > > Do you know any others I might be missing?
> >
> >
> > IIRC joel sent a patch for beagle as well a few weeks ago, here's a copy:
> >
> >
> http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-texasinstruments/plain/recipes-bsp/x-load/x-load/0001-Beagle-Rev-C5-support.patch
>
> It's not in the list archives, so I'm not sure if this was sent to
> the x-loader mailing list.
>
> I'll pick it up and merge it later today.

Found it in the mailing list archives - don't know how I missed it earlier.

Applied now.

- Anand

Reply all
Reply to author
Forward
0 new messages