Skip to contentSkip to conversation

efi_stub: Move carriage return before line feed in putc()

PATCH New Bin Meng 2 participants 6 messages Mar 18, 2016 – Mar 27, 2016

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/2 efi_stub: Move carriage return before line feed in putc()

A carriage return needs to execute before a line feed.

---

 lib/efi/efi_stub.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/efi/efi_stub.c +3 -2
index e138709..8b4bb4e 100644
@@ -65,6 +65,9 @@ void _debug_uart_init(void)
 
 void putc(const char ch)
 {
+	if (ch == '\n')
+		putc('\r');
+
 	if (use_uart) {
 		NS16550_t com_port = (NS16550_t)0x3f8;
 
@@ -74,8 +77,6 @@ void putc(const char ch)
 	} else {
 		efi_putc(global_priv, ch);
 	}
-	if (ch == '\n')
-		putc('\r');
 }
 
 void puts(const char *str)
Signature · 1 line
1.8.2.1
author
#1 lore raw

PATCH 2/2 debug_uart: Remove duplicated carriage return handling

Since commit b391d74 "debug_uart: output CR along with LF", the handling in puts() is duplicated, not to mention that it should output carriage return before line feed.

---

 common/console.c | 2 --
 1 file changed, 2 deletions(-)
common/console.c +0 -2
index 6a0d11b..12293f3 100644
@@ -515,8 +515,6 @@ void puts(const char *s)
 			int ch = *s++;
 
 			printch(ch);
-			if (ch == '\n')
-				printch('\r');
 		}
 		return;
 	}
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH 1/2 efi_stub: Move carriage return before line feed in putc()

In reply to Bin Meng
Quoted 3 lines · Bin Meng

A carriage return needs to execute before a line feed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160318/d10ccaa3/attachment.sig>
#2 lore raw

PATCH 2/2 debug_uart: Remove duplicated carriage return handling

In reply to Bin Meng
Quoted 5 lines · Bin Meng

Since commit b391d74 "debug_uart: output CR along with LF", the handling in puts() is duplicated, not to mention that it should output carriage return before line feed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160318/17a7297b/attachment.sig>
#5 lore raw

PATCH 1/2 efi_stub: Move carriage return before line feed in putc()

In reply to Bin Meng
Quoted 4 lines · Bin Meng

A carriage return needs to execute before a line feed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160327/c61fa340/attachment.sig>
#3 lore raw

PATCH 2/2 debug_uart: Remove duplicated carriage return handling

In reply to Bin Meng
Quoted 6 lines · Bin Meng

Since commit b391d74 "debug_uart: output CR along with LF", the handling in puts() is duplicated, not to mention that it should output carriage return before line feed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160327/7d048ea9/attachment.sig>