Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp252761rdb; Mon, 22 Jan 2024 03:08:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP/M0WsbPtOKmmQoYFgX0Er2Xi+6ofKf8e0i6KEiM/8+IMmp455DbxjNoSOFeNT3NViYyQ X-Received: by 2002:a17:902:9304:b0:1d5:c1ca:489e with SMTP id bc4-20020a170902930400b001d5c1ca489emr3659700plb.98.1705921727031; Mon, 22 Jan 2024 03:08:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705921727; cv=pass; d=google.com; s=arc-20160816; b=A+ZZnMNSXXZP4tHYTtfn4Iia50e8nR2QVkUk+6HPGGwcfijtuCQBtBFycaLPepHhZw a/L0QMhxnHEH6IiW/QFLZeNwtamDDuZMcm8p8C9BSVHRxYRD516Bi/bXXRnvz0wkhEA/ l8882fGQUiOwT/M/L/uP3Dr5VgCfUFRa5wHPghMBpQgzJOSSFSyprQIYZvTnJfeIItv5 YcO6BYjduWjwinIjJcjjudekRhrpoi4zBYgo3XYpAj7GylTf8NtoM3tPYARdng42sv8Y ty0er/woIHeMyZtmAy1L+OQx0Kyhl5Gawzhb0IIK9ubJplxEQOotsM24VL0c2nS4YRdS Lf3g== 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=MJYOs2ytuFP7FOaR7mkbl0m+e36EkFd7YT+/Mdtp8Qc=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=yOmBhDnaTTsi/wp0/jvQrEq/C49B4FYOrOCUPqABgE+NBbBf6EEzLM1vgAtiQpIbu9 0lBSQiWJmBxptmK9XWowhiHqaP5rIrfYou3IYf3+4cBR55vBthqzOln+75YS3OXG09cq SfPXGr07OzMlbXx4OkEaav8E6C/17dKNlaeNf5f161V5UqQ22V0+WG0ZDNWoL+KQD6FV ZtYbjECYrcXnDjJ+4YId7vf+uFSzOedOuahKeIe7Vv+Kn6uw7Qx7t8xK6MhRASoq5NoB RrygiDWjkvhdiNH19IsbmhdImlDzs2vTjkQ0jyFcYC+cUkJN5LIyxwpaJDs/52HifIbF 1cHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FmoKgcGb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h15-20020a170902680f00b001d6efd0f3b9si7917120plk.571.2024.01.22.03.08.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 03:08:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FmoKgcGb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32821-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 115FB281835 for ; Mon, 22 Jan 2024 11:08:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 955563D558; Mon, 22 Jan 2024 11:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FmoKgcGb" 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 C0F073D548; Mon, 22 Jan 2024 11:04:28 +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=1705921468; cv=none; b=jrOXuBcStoWq9keiVQkwU6O48o4Yu7oHQ1azgBSras0/WJnLo4XAYNUtbIiC4DinFGl0nPGKVtDEFPadSbks0PFrOefbn0PyX2WSsL+SOuv3cx56Win7jn65ipRKNPwoRMbLoNLpjpXeILFy8t+kywWuGDEvOlhKnpJhCbICOFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921468; c=relaxed/simple; bh=AXiRX8dRFFCRyZh6z4CAVlWbUqnScmiBQUZ2UxbtulE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NigOrSHVUh/aVqB2oixQO2H2Nf7+HgfDgssXaDiCFZ0cfxgFPcMm2B3hyYIcL2S6pJah716X2Uf/z70EXT7onl90+zwIlmDUvLA953caei4I5H8cZDK1XGtw5xOTQGTru/JlIEQX/bU9/rNRQ4bsUajwzKPAV+GmIfX9Z7j7hBU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FmoKgcGb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80F36C433F1; Mon, 22 Jan 2024 11:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705921468; bh=AXiRX8dRFFCRyZh6z4CAVlWbUqnScmiBQUZ2UxbtulE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FmoKgcGbf6TyPm8w1G7cv7iJTCN4nL1ux4EgH3nIEqwHTuYPDFn5aejw6mG7S/u05 5YsPpgQkk0prPrSVTnKMcFJkBvzSzCTob/lzQlVdfS/KKusjf3nRjJYPs5YmLiXkgF sMjq/IP9JqCN+rBHvNf+fy4sPyna9xhdfKFrDYs0wyGaCXl7LFcgiClusZCSXvls6E oVCcHX5/3LPrucSA2x+5TEmnr7M0kTRkEUPmIvkwZ1Le33mr8GAPEc3axMIGzKvk4Q AuDMLTrgl93GW653h/XX8UAm4yzA26M1wqtJT5DMfpQ5W7D/1oVkiFI8z55IfIJNF2 PnOrhUFeT8dwg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH v2 12/47] tty: vt: reflow csi_J() Date: Mon, 22 Jan 2024 12:03:26 +0100 Message-ID: <20240122110401.7289-13-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122110401.7289-1-jirislaby@kernel.org> References: <20240122110401.7289-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 Push cases one level left, according to coding style. And reorder local variables. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/vt/vt.c | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 85e89fb9b207..bf77d962eeb4 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1507,34 +1507,34 @@ enum CSI_J { static void csi_J(struct vc_data *vc, enum CSI_J vpar) { + unsigned short *start; unsigned int count; - unsigned short * start; switch (vpar) { - 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, - vc->vc_rows - vc->state.y - 1); - count = (vc->vc_scr_end - vc->vc_pos) >> 1; - start = (unsigned short *)vc->vc_pos; - break; - 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 CSI_J_FULL: - flush_scrollback(vc); - fallthrough; - 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; - break; - default: - return; + 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, + vc->vc_rows - vc->state.y - 1); + count = (vc->vc_scr_end - vc->vc_pos) >> 1; + start = (unsigned short *)vc->vc_pos; + break; + 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 CSI_J_FULL: + flush_scrollback(vc); + fallthrough; + 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; + break; + default: + return; } scr_memsetw(start, vc->vc_video_erase_char, 2 * count); if (con_should_update(vc)) -- 2.43.0