Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp190789rdb; Thu, 18 Jan 2024 00:01:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IENGlGdLDhYndVH61kL+ch9PPVR/pzu8nzdCEtrOU1HnDILuYvoRqLxY23fvfUtrAMt2P2w X-Received: by 2002:a05:6214:124c:b0:681:63d5:876d with SMTP id r12-20020a056214124c00b0068163d5876dmr551609qvv.107.1705564893436; Thu, 18 Jan 2024 00:01:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705564893; cv=pass; d=google.com; s=arc-20160816; b=FMCLDXrRQ0c5bQV/9A3SvsvjWSctz6PRLEfs69tNYl2GNlcOWZNBTF740hCuQfydeW WbqaQSXjYnRAzzFwzxvZ2clx3SEYbzuDvyS1pn+jr9EkG9R1KVpCqLjtzcHMO5LJHdRL XE/xS/h+Fw/+hZO8FmzNTLAU9mpotG4UJxWS1PxmOqLD80cD8il55dzVqF0KpYEgjCAm C8u5bfCqs0IZwzRvDdTBDut7qmZi2tPGvzUxAftrRpChIz5tGrWwpbSa0hjl93l59baU Ng38M6ieQEe0RtP0+4fhlyspuxWIvyWZEDyVCpCnwKAYwv/glAWgm07jSH54h8GzjNaM T81g== 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=sMB4yz4luW5YjIPRPGk6ntlDh9mPIYo/zljEgPJiNIE=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=vQyfm20m05KIEUApw/yVZ0ZLhlZisFWYGnaxev0ePuGK1qhaKzDsON9+LAE7PEXEMC +R9SCtCJlUew8FZ42AkmfDnj3GxrRxlkRyuU3EaCDpWqvLIz4FkY8P+uyAX/Nzh9QiVr X4ak7TcDHFguWnCp255O81SFtRrLhdZ1UO/Q5Cyg7fJS4crmxLOeTw7orO8wg8e24IbC U2RLr1J8y02k8tybf5zTg4j8ig67TId/OKJ2iKwi75Y/K4kmwt1vgBRDxXHlSAqn59JY CYTev9+KZsv/v3AfBVoW/wD+nk+QZjtpbYPtOgan1mHapDbK4Y2mbXb0L0wxZZZSAQqv LBFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vHJi7AO1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-29800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y17-20020a0ce051000000b0067f8d88de06si3410036qvk.471.2024.01.18.00.01.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 00:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vHJi7AO1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-29800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29800-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 343291C216E4 for ; Thu, 18 Jan 2024 08:01:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 402B0125B1; Thu, 18 Jan 2024 07:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vHJi7AO1" 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 67C8025767; Thu, 18 Jan 2024 07:58:27 +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=1705564707; cv=none; b=nQhP00zaVE/32Nkz0H3wZM3ki7cfCBQNbKpkSz92w1mlhcfXEqXM1IdIsUchYlVxad6xbASh8eo/KB0Y/UuBlcsO3OBXmInc++YYi6ZW26TzSqMQCh6RV7sN66iGqJtHEdx/FqJI/Qgrp8iSLoKIbeLUgVAJpPJ05AX7gYSgUwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705564707; c=relaxed/simple; bh=xmX1GzocGEugxu/cnlcvvwjE5Bbm+09jL2ht7Rb2p+g=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=kCbPm6ukr/ZFj4ZVMf4FC4ijfAr5aE1f+Vnf1oNbHTnlM4TkvGL0ffCf2iAtcPgFyX+DWRcjX0wL7H5Ufn71OUhYNCoEUYtGiAHaiSs1ppcW+W7rg2NWgSd6N8Lchik6TcFTCgPoMQVA577g82aDKt1kGzv/bodg104fUvAi/qQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vHJi7AO1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2C00C43390; Thu, 18 Jan 2024 07:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705564707; bh=xmX1GzocGEugxu/cnlcvvwjE5Bbm+09jL2ht7Rb2p+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vHJi7AO1PNdvAsN7hDS1juOpdy9ki5ylj3fmAxuqH+AYBbTbF1FsFXF/9gdbMaSwT 1U1PjhFNjAx7ZTgbwRmrs7u8lR263THO5/wK2K7NSrqomwLoE0Q/1UU3DN76FAEqMp hkn3FyJY9I5EPye8XJ0z2C1EdGFMIYpna0B7kYZnbYNi2zfOLKvfpgtJrpvlDkBLlW 4smxs9ZspcFIOKluQwaIcYRXM4lCf53SejjCr7sjm+LGzhK9c3E/I/IwHuVbsWlNM8 QL3UH9MLnS7P938tg942WbkgoVh0cgfFTGFdy1VAqkkBCCoSps32QBYIYOlBGn55Rs /txVwh+wAeZbQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 13/45] tty: vt: define an enum for CSI+K codes Date: Thu, 18 Jan 2024 08:57:24 +0100 Message-ID: <20240118075756.10541-14-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118075756.10541-1-jirislaby@kernel.org> References: <20240118075756.10541-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Decrypt the constant values by proper enum names. This time in csi_K(). Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/vt/vt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 22ef7366c155..3e3ec9c28f26 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1542,6 +1542,12 @@ static void csi_J(struct vc_data *vc, int vpar) vc->vc_need_wrap = 0; } +enum { + CSI_K_CURSOR_TO_LINEEND = 0, + CSI_K_LINESTART_TO_CURSOR = 1, + CSI_K_LINE = 2, +}; + static void csi_K(struct vc_data *vc, int vpar) { unsigned int count; @@ -1549,15 +1555,15 @@ static void csi_K(struct vc_data *vc, int vpar) int offset; switch (vpar) { - case 0: /* erase from cursor to end of line */ + case CSI_K_CURSOR_TO_LINEEND: offset = 0; count = vc->vc_cols - vc->state.x; break; - case 1: /* erase from start of line to cursor */ + case CSI_K_LINESTART_TO_CURSOR: offset = -vc->state.x; count = vc->state.x + 1; break; - case 2: /* erase whole line */ + case CSI_K_LINE: offset = -vc->state.x; count = vc->vc_cols; break; -- 2.43.0