From patchwork Sun Nov 29 16:46:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1407838 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=wOYThAh3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CkZ662WGrz9sT6 for ; Mon, 30 Nov 2020 03:47:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6CF98278A; Sun, 29 Nov 2020 17:47:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="wOYThAh3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CFFAA82783; Sun, 29 Nov 2020 17:47:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 04B0482738 for ; Sun, 29 Nov 2020 17:47:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3250520738; Sun, 29 Nov 2020 16:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606668425; bh=1gE8ck/qau0dgq7nwsACxyoL5X1BImdt70AgrvGH1pI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wOYThAh3cFv05sRvNLT6LQeOt4Mw0SXHps+/abAlHc9kHwu4sy7fSdAwp4RMvZTkI miUiN2gqlEx/mT+uden+93naXnasyt3Vvuhakvlgn6MRTEKpdscIRtyRht3v6CnGDz b4vYFs293NMRAp/SvmV5vN1acmU1bckGTck0K9DU= Received: by pali.im (Postfix) id 5CD06765; Sun, 29 Nov 2020 17:47:03 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lokesh Vutla , Lukasz Majewski , Marek Vasut , Simon Glass Cc: Ivaylo Dimitrov , Tony Lindgren , Pavel Machek , Aaro Koskinen , Merlijn Wajer , u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH 01/13] serial: usbtty: Fix puts function Date: Sun, 29 Nov 2020 17:46:06 +0100 Message-Id: <20201129164618.5829-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201129164618.5829-1-pali@kernel.org> References: <20201129164618.5829-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This function has incorrect implementation of prepending CR prior LF. Without this patch it prepended CR prior whole string which is going to be written and let LF without leading CR. Fix this issue by inserting CR at correct place to make output on usbtty serial console more readable. Signed-off-by: Pali Rohár Reviewed-by: Pavel Machek --- drivers/serial/usbtty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index f1c1a260da..02f8edf200 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str) n = next_nl_pos (str); if (str[n] == '\n') { - __usbtty_puts("\r", 1); - __usbtty_puts(str, n + 1); + __usbtty_puts(str, n); + __usbtty_puts("\r\n", 2); str += (n + 1); len -= (n + 1); } else {