mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/5] console: remove duplicate newline conversion
Date: Tue, 19 Jun 2018 08:41:14 +0200	[thread overview]
Message-ID: <20180619064117.13904-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20180619064117.13904-1-s.hauer@pengutronix.de>

When the console is not yet fully initialized then console_puts falls
back to print characters using console_putc. console_putc already
does newline conversion, so do not repeat it in console_puts.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/console.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/console.c b/common/console.c
index c40eba6d55..cd37d88cc4 100644
--- a/common/console.c
+++ b/common/console.c
@@ -552,10 +552,9 @@ int console_puts(unsigned int ch, const char *str)
 	}
 
 	while (*s) {
-		if (*s == '\n') {
-			console_putc(ch, '\r');
+		if (*s == '\n')
 			n++;
-		}
+
 		console_putc(ch, *s);
 		n++;
 		s++;
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2018-06-19  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  6:41 [PATCH 1/5] console: add missing newline conversion for putc_ll Sascha Hauer
2018-06-19  6:41 ` Sascha Hauer [this message]
2018-06-19  6:41 ` [PATCH 3/5] console_simple: Remove duplicated newline conversion Sascha Hauer
2018-06-19  6:41 ` [PATCH 4/5] console_simple: Fix " Sascha Hauer
2018-06-19  6:41 ` [PATCH 5/5] console_simple: add newline conversion for putc_ll case Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180619064117.13904-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox