From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBC9D1E9098; Mon, 21 Oct 2024 10:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507606; cv=none; b=tJD+X/iZYxX9d2/5XdYxIay/g9mamjNtG4U4G7OO7+6uPxW3XneCkEjC5ygYnlM8S5wIqqWUjkOKfw7IO+pBp3l27WIDffocjDDXk6rMKrZFON9kGSfn0Sb1RzAFlaf4ytNkv4HxlcmqrsVncaMatKOJ1TZ5hdz+Xv04D0sqNDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507606; c=relaxed/simple; bh=mFUZqQ4mkI5A36e5ZIS2NuGi+BT37LJsYf5LgDElXUw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BdY3wNrrk/u44S0310E2C+QqknbGHjKBBDmkV7DBPjU+B3MqSQGU+M27Q0gidR7ou+P3eHtlWNsTq2Hs5JuRtp3eHfV2LRx5J+k41byLHqN8hPy/R9WeP9BT8exgH/DU2nevJ01zlcc/NYkN9D21QcuglUqrC2A3nzyIMwp4LYk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VLzC2fxK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VLzC2fxK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AFD3C4CEC3; Mon, 21 Oct 2024 10:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729507606; bh=mFUZqQ4mkI5A36e5ZIS2NuGi+BT37LJsYf5LgDElXUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VLzC2fxKyoS6S4CMqTOetsLHXXTGaNDMIFlg0uGS9hNeuWTTz3Ug8s+M9asxoDWyw XSGe8t25JlK9qexzA7reCIbrJvK5PNPCM0ZsMO6BT/G2JCxS4cfR1b2RypdaLLmYAg KMENa3WdPPL5Xxw7cCjseGcndRCUG8TlQ0KTTuPA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Sven Schnelle , Heiko Carstens Subject: [PATCH 5.15 40/82] s390/sclp_vt220: Convert newlines to CRLF instead of LFCR Date: Mon, 21 Oct 2024 12:25:21 +0200 Message-ID: <20241021102248.824635034@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021102247.209765070@linuxfoundation.org> References: <20241021102247.209765070@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Weißschuh commit dee3df68ab4b00fff6bdf9fc39541729af37307c upstream. According to the VT220 specification the possible character combinations sent on RETURN are only CR or CRLF [0]. The Return key sends either a CR character (0/13) or a CR character (0/13) and an LF character (0/10), depending on the set/reset state of line feed/new line mode (LNM). The sclp/vt220 driver however uses LFCR. This can confuse tools, for example the kunit runner. Link: https://vt100.net/docs/vt220-rm/chapter3.html#S3.2 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh Reviewed-by: Sven Schnelle Link: https://lore.kernel.org/r/20241014-s390-kunit-v1-2-941defa765a6@linutronix.de Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- drivers/s390/char/sclp_vt220.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -320,7 +320,7 @@ sclp_vt220_add_msg(struct sclp_vt220_req buffer = (void *) ((addr_t) sccb + sccb->header.length); if (convertlf) { - /* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/ + /* Perform Linefeed conversion (0x0a -> 0x0d 0x0a)*/ for (from=0, to=0; (from < count) && (to < sclp_vt220_space_left(request)); from++) { @@ -329,8 +329,8 @@ sclp_vt220_add_msg(struct sclp_vt220_req /* Perform conversion */ if (c == 0x0a) { if (to + 1 < sclp_vt220_space_left(request)) { - ((unsigned char *) buffer)[to++] = c; ((unsigned char *) buffer)[to++] = 0x0d; + ((unsigned char *) buffer)[to++] = c; } else break;