[U-Boot] [PATCH 1/2] efi_stub: Move carriage return before line feed in putc()

A carriage return needs to execute before a line feed.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
lib/efi/efi_stub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index e138709..8b4bb4e 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -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)

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.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
common/console.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/common/console.c b/common/console.c index 6a0d11b..12293f3 100644 --- a/common/console.c +++ b/common/console.c @@ -515,8 +515,6 @@ void puts(const char *s) int ch = *s++;
printch(ch); - if (ch == '\n') - printch('\r'); } return; }

On Thu, Mar 17, 2016 at 11:59:04PM -0700, Bin Meng wrote:
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.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Reviewed-by: Tom Rini trini@konsulko.com

On Thu, Mar 17, 2016 at 11:59:04PM -0700, Bin Meng wrote:
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.
Signed-off-by: Bin Meng bmeng.cn@gmail.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

On Thu, Mar 17, 2016 at 11:59:03PM -0700, Bin Meng wrote:
A carriage return needs to execute before a line feed.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Reviewed-by: Tom Rini trini@konsulko.com

On Thu, Mar 17, 2016 at 11:59:03PM -0700, Bin Meng wrote:
A carriage return needs to execute before a line feed.
Signed-off-by: Bin Meng bmeng.cn@gmail.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (2)
-
Bin Meng
-
Tom Rini