All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tiny-printf: Support %i
@ 2020-04-10 18:54 Marek Vasut
  2020-04-10 20:47 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Marek Vasut @ 2020-04-10 18:54 UTC (permalink / raw)
  To: u-boot

The most basic printf("%i", value) formating string was missing,
add it for the sake of convenience.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
---
 lib/tiny-printf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 1138c7012a..8fc7e48d99 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -242,6 +242,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
 				goto abort;
 			case 'u':
 			case 'd':
+			case 'i':
 				div = 1000000000;
 				if (islong) {
 					num = va_arg(va, unsigned long);
@@ -251,7 +252,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
 					num = va_arg(va, unsigned int);
 				}
 
-				if (ch == 'd') {
+				if (ch != 'u') {
 					if (islong && (long)num < 0) {
 						num = -(long)num;
 						out(info, '-');
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-05-01 21:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 18:54 [PATCH] tiny-printf: Support %i Marek Vasut
2020-04-10 20:47 ` Simon Glass
2020-04-10 20:52   ` Marek Vasut
2020-04-13 23:42     ` Simon Glass
2020-04-14  1:16       ` Marek Vasut
2020-04-13 23:27 ` Tom Rini
2020-04-14  1:17   ` Marek Vasut
2020-04-14  2:18     ` Simon Glass
2020-04-14 12:30       ` Marek Vasut
2020-04-14  3:03     ` Tom Rini
2020-04-14 12:24       ` Marek Vasut
2020-04-14 13:26         ` Tom Rini
2020-04-14 13:40           ` Marek Vasut
2020-04-14 14:11             ` Tom Rini
2020-04-14 15:22               ` Marek Vasut
2020-04-14 23:01                 ` Tom Rini
2020-04-15 18:09                   ` Marek Vasut
2020-04-14 14:41             ` Simon Glass
2020-04-14 15:23               ` Marek Vasut
2020-04-15  0:26                 ` Simon Glass
2020-04-15 18:10                   ` Marek Vasut
2020-05-01 21:55 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.