Message ID | 20240202065608.14019-18-jirislaby@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp252386dyc; Thu, 1 Feb 2024 23:01:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUtuVSWprQYRcK/CBX0DK3vZvsttSSsWJJWgykF/EboEpuJp+C8bHjKfRIzDBXKtfkJbs3 X-Received: by 2002:a17:906:7853:b0:a31:4e96:f40a with SMTP id p19-20020a170906785300b00a314e96f40amr829081ejm.26.1706857277769; Thu, 01 Feb 2024 23:01:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706857277; cv=pass; d=google.com; s=arc-20160816; b=kxm6L2Drvs7jVJK7jHqGEtlj9y7gxw8eJ6RXWsXW7EcZS0xC5Acgx2/SwoDteFtMae aXAyz60Aa/0ut5CUUK/2lbut823J1vFxsZyZsbxnvhBGiSTgthh0ns9rxQ7gmvJlkDjj fQBgPzwsCa5xC3gG89+Z4LukX/jgtM+ue8E8S7LXEJBeNB5l8YlHRH85S+xWjx84qtP3 dqTWEwWfVCVKqJOna2SgzoKKs68PhCt8WVdAZOs6kcat6CfkEEAF9e3WU5+8UEVF8lWY fLq7lbCRgoZd4GZJPGZJsC5ZWE3YmgGFQiZ50agZ8lu+UJfuE7tcdcQVECk5tPsSa73E 1YeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=iDtcs5UkS+sxdBXd45EDg8inKGPPjVFp2G0PuhQnM+I=; fh=NsVhVHBy7ADYAlAtfvwmKKDY3WHjSd89UYsZv8YEtAM=; b=WfK+xuUpEeSKywPhE1pKQQb1Hvvwvbk3dEjCRsA5sIDZiP8egpTORmCZaHKWGfIrOE 9qaNVsBimqBKNJn3akHF//ndB6cTZuQICiuPUx4XncBTb1sSijc3DtxYRvHks/BkOy/J rjDDk47LTfB9uv6rnZS5agN+EkVFHLFIv1j1ylxhQC/VLdgc0wsPT6mxwpHTpRpmNq9a 6CRNvuBTfg4VqSnf0shz2SVA9C+Ne49cBwtGyq6nODxICv+02TumwgKnqa4clRqpP79T LBV17YlSHI+nzAgkiRJ1Gt3ZAoMyI2QudFYLYyxDspJOqp+Xqk98kMkVTHGaUf3KWbbC VwcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNcB9rBM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWOKLPGLyGCKFHqlTplYORJdXCNLIxRKQei//VR5R2xw1Z4rDJ1U8AxadOn9iYdgdyyO4s8aHjP/myMnW50u2ZP3WZbIA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qx9-20020a170906fcc900b00a317a8cd7c5si543924ejb.967.2024.02.01.23.01.16 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 23:01:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNcB9rBM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 468441F21A89 for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 07:01:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA98548782; Fri, 2 Feb 2024 06:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VNcB9rBM" 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 1D92A482CA; Fri, 2 Feb 2024 06:56:37 +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=1706856998; cv=none; b=t8CMOHToJNj10I7fLFUHSuhnPsMAp97DLlL31F0Ln3AQmGkyMIgzgFRGlG23/JeqzH50+BFcmyFOD+bSKG53lKSIRE8otsSObQn3AGoJ2aLwq7ZPgmrpSOxWbPQDaqyuxdWD+dn6nBMg6FOsoG+tGbjEjEwTE/IPVj+GENvci+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856998; c=relaxed/simple; bh=6UXhr7Um6o27JtU1FYPkbandRU53JbY5Vx7820lgPtw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Iap8SAcHBlz4+r1pKA4pAMy5n8//SI2moQgttmFAAb2q9XuOQVBO19I7KL72Jb1VXbbpeIEUX53idGQ/OmtXL9QjNoW5pmjHfUjhmtst2AisaAfYcngGHJb1bDEqVYlEfT43bLKep58kEJLPBVRunSa53NgjFL2nuXk5Vx5zihs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VNcB9rBM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84317C433C7; Fri, 2 Feb 2024 06:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706856997; bh=6UXhr7Um6o27JtU1FYPkbandRU53JbY5Vx7820lgPtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VNcB9rBMdt2/bzWjEIv48297aN92UMaLGhsgrEldMtKrkB6v9X6dJYFgsKHT1ZQjC H6STC1iuvWrOxp0oc/AGH8j9HXJ4yKl5+5XusRZMwsaWxqs6gAVaQjh0rJx/fWLVo0 g6Nrxe/cFIaXjdpJy7ugxJRu+JFBOYpzp9VHUwl20dR8jYexv3PzFX7BbFGQDMQZFw UmyG2kMQv0myvrVaqLheIQb7T7rhvd0PHZH9k9DI/FqSAy6VBHqmasRlbKEofm6Xxc 2FGyIh3pYQoLqauteqk/HyN+qhkhcPzklQxcaR/0rCwPmV7DOSxamr14a4o6wdBPmj PrVOdWqL++xjw== From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Subject: [PATCH 17/22] tty: vt: handle CSI+[ inside preexisting switch-case Date: Fri, 2 Feb 2024 07:56:03 +0100 Message-ID: <20240202065608.14019-18-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240202065608.14019-1-jirislaby@kernel.org> References: <20240202065608.14019-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789769575547586062 X-GMAIL-MSGID: 1789769575547586062 |
Series |
tty: vt: cleanup ESC sequences handling
|
|
Commit Message
Jiri Slaby
Feb. 2, 2024, 6:56 a.m. UTC
In do_con_trol()'s ESsquare case, there is already a switch (c). It is
preceded by an 'if (c == '[')'. Despite this 'if' handles a state
transition and not a modifier, move it as one of the switch cases. This
makes all the 'c' decision making more obvious there.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
drivers/tty/vt/vt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index e1cbe966bc84..4d020a9967a2 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2603,11 +2603,10 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, u8 c) vc->vc_par[vc->vc_npar] = 0; vc->vc_npar = 0; vc->vc_state = ESgetpars; - if (c == '[') { /* Function key */ - vc->vc_state=ESfunckey; - return; - } switch (c) { + case '[': /* Function key */ + vc->vc_state = ESfunckey; + return; case '?': vc->vc_priv = EPdec; return;