Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp812814rdb; Thu, 18 Jan 2024 22:31:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXJcOSSzTsbSdLo9B0NhjLK9kI/wHXWXhdWD11LtANiJ90EHE6WfuT5lQim3n9U2Szb6dW X-Received: by 2002:a05:620a:36c4:b0:783:36aa:468 with SMTP id cz4-20020a05620a36c400b0078336aa0468mr822648qkb.130.1705645914145; Thu, 18 Jan 2024 22:31:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705645914; cv=pass; d=google.com; s=arc-20160816; b=TAx4fAkr0vDchsfUiuyG9sUuPJ5mqYAkqkKslLvSc2WhE7bZBz/TkwTa7Q/MkgABv/ GO10qQTGcyPg7V2l4u1N3GViakAKIyIib8TfKUUo+q4JwPKgIM6FE8wkOQuB+ksMfh1I Tm6AMQy3Jr/G9yEuW8bxLv5kswwtY8xD7ju9HgKEcoJiiuHNd8hugx5rCPF8Z+ddD/gk terpQniyOL//wt5cVnH0Pcie+bNIWgxUYw0dYTDWZfnaPjbbdt/gL9kirwIY+pdESfVY OAGKdbXmJOtXkR71y8bVap3QPJGBSobggmR0XilTJuuLfHl2SHIgSHLmCDeT5iQBtsH4 78Ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=7rgq+nShpQau+v2jsE7HPUUMJIPYJu7zwY2PL11pPIU=; fh=RhCm5A/ue9eWv8iSuCcDAfu20TtAtAn/YGD09/62LKc=; b=Op/+YTyUCkFnbGvKvShGfMpd9aVBvVvbcxSAA9KMnygcUCLNsfFdegYha2WnDKzoQg YXFhRfokM/zvQ2cBz2IOg6MwdVeUTUSlYrj32JS75o5OpZ3654/GfR4P+rmv9dA4JwvD lbfjGAKCD01KEQDWgW/G16JmkuxskH3aKTm3rc/Kv+EvhSyLuV0I/DIGpjQA6PnGZdxd WrmIqg4PrZqy/LNXzVTmKgPUCCr4SKLXQtug0CNXtJ0hbgTjU26BRiUYIo5Lp5CeO23L I8x31SANr7xEayvxA0N5sWZs2mXfsOGL/sDfUYL8N5EgpNmWxbUMeaJ7kSGkOkLQ8NuG vK9Q== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-30817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30817-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 b8-20020a05620a088800b0078330b1c9f7si15411656qka.458.2024.01.18.22.31.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 22:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30817-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-30817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30817-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 D33B91C22FBD for ; Fri, 19 Jan 2024 06:31:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28BF6D53F; Fri, 19 Jan 2024 06:30:40 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 067E51870; Fri, 19 Jan 2024 06:30:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705645839; cv=none; b=nDZrhug/L8gXqreBSnAiV4LYxFYeB6KUJMpPgqycyK+vqs/npJB21cD5XPhV3VPl66mP8YqA7X8INkUlebKLW+UjW6KNxNVeKwlkqsN9/UAn720z3DzLJDfIEdMtgmBZ+LvdIXrldr13DcgkNtzG6V0QjLQWxZerYQKF8yLjg7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705645839; c=relaxed/simple; bh=KUgx2pM5cI1yM/hgJHoX/TsILAcbxzC/uA7dOOIXum4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K47HbsfVBK30TNbQZqhaVN1ExSsfpnXsphojmosTvaJzGt4iZxYbWzRIFxBnV7sGjLgQaKUOaPxwuxboz509P7VMdOSoqs3rT+pe2EW/daRB5O1B/sDgtTb4N7JbdbkUPuWtosbJvhNN0jgsExEfwt8Hw3SkVn1QuB7OchlpHN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40e9ef9853bso598135e9.1; Thu, 18 Jan 2024 22:30:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705645836; x=1706250636; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7rgq+nShpQau+v2jsE7HPUUMJIPYJu7zwY2PL11pPIU=; b=UNaYhc0uSP/eqWfvtirjQ4Sk9pACISwOsXm4ov5DSDmks/X+9p7k1KRsMOs/ySsD/+ sXEjS7kZTl8Y6C4qnnqa4wspX3W/SimtPRewTLk8DhCY9QhffoBiIXNVL7JZsmJH8NhA e7zRcfBA3ytOpKcjEHFqOPeu+ydODPEgSwH6wIry4LmI8PzFdET8fsdLISb7tNYwKiw4 DOUyAh/0KBB1AcUxKtCYuKC4KlO1gnulVYbynrLdVG3iJrKKeJtftKCNNox64iER8Qp3 rDTJJMEizOvHrf9AhYeOQavuP+Rk1kdcJ85HkylxGeQn2HGEQUUJazjkpOCifUnqsu1J //bg== X-Gm-Message-State: AOJu0YycEK6VyQfRDxCzZ0wfnEXpxcNticGc4gqWsvTJV0sKyIzpIzfn K4G/dS2ejh76AQ5ukditsoIkonRx2KsUTuuvcJrxSKtO/WmXNOck X-Received: by 2002:a05:600c:181b:b0:40e:7619:a2d3 with SMTP id n27-20020a05600c181b00b0040e7619a2d3mr218199wmp.105.1705645836008; Thu, 18 Jan 2024 22:30:36 -0800 (PST) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id g21-20020a05600c311500b0040d30af488asm31794794wmo.40.2024.01.18.22.30.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 22:30:35 -0800 (PST) Message-ID: <0bfbf5ab-eceb-4dc0-a1c3-42da29ca9c93@kernel.org> Date: Fri, 19 Jan 2024 07:30:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/45] tty: vt: define an enum for CSI+J codes Content-Language: en-US To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240118075756.10541-1-jirislaby@kernel.org> <20240118075756.10541-12-jirislaby@kernel.org> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwlvuwyfo5mh7w5iMfnZE+vHFwp/wARAQABzSFKaXJpIFNsYWJ5 IDxqaXJpc2xhYnlAa2VybmVsLm9yZz7CwXcEEwEIACE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S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240118075756.10541-12-jirislaby@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 18. 01. 24, 8:57, Jiri Slaby (SUSE) wrote: > Decrypt the constant values by proper enum names. This time in csi_J(). And there are more calls of csi_J(). All those should now use the enum constants. v2 will fix this. > Signed-off-by: Jiri Slaby (SUSE) > --- > drivers/tty/vt/vt.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c > index 66ebc90a9fe9..4f7831f81db6 100644 > --- a/drivers/tty/vt/vt.c > +++ b/drivers/tty/vt/vt.c > @@ -1498,13 +1498,20 @@ static inline void del(struct vc_data *vc) > /* ignored */ > } > > +enum { > + CSI_J_CURSOR_TO_END = 0, > + CSI_J_START_TO_CURSOR = 1, > + CSI_J_VISIBLE = 2, > + CSI_J_FULL = 3, > +}; > + > static void csi_J(struct vc_data *vc, int vpar) > { > unsigned int count; > unsigned short * start; > > switch (vpar) { > - case 0: /* erase from cursor to end of display */ > + case CSI_J_CURSOR_TO_END: > vc_uniscr_clear_line(vc, vc->state.x, > vc->vc_cols - vc->state.x); > vc_uniscr_clear_lines(vc, vc->state.y + 1, > @@ -1512,16 +1519,16 @@ static void csi_J(struct vc_data *vc, int vpar) > count = (vc->vc_scr_end - vc->vc_pos) >> 1; > start = (unsigned short *)vc->vc_pos; > break; > - case 1: /* erase from start to cursor */ > + case CSI_J_START_TO_CURSOR: > vc_uniscr_clear_line(vc, 0, vc->state.x + 1); > vc_uniscr_clear_lines(vc, 0, vc->state.y); > count = ((vc->vc_pos - vc->vc_origin) >> 1) + 1; > start = (unsigned short *)vc->vc_origin; > break; > - case 3: /* include scrollback */ > + case CSI_J_FULL: > flush_scrollback(vc); > fallthrough; > - case 2: /* erase whole display */ > + case CSI_J_VISIBLE: > vc_uniscr_clear_lines(vc, 0, vc->vc_rows); > count = vc->vc_cols * vc->vc_rows; > start = (unsigned short *)vc->vc_origin; -- js suse labs