Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp256808rdb; Mon, 22 Jan 2024 03:18:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRO22tZiPkvjeP7SLB/o479TFlCxYDB13Bd/xPvuIhC84sLoyLnDQDwZonhIBUAISPKVL4 X-Received: by 2002:a05:620a:22a7:b0:783:98f8:4ca6 with SMTP id p7-20020a05620a22a700b0078398f84ca6mr3135023qkh.108.1705922284040; Mon, 22 Jan 2024 03:18:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705922284; cv=pass; d=google.com; s=arc-20160816; b=GddGudEQdDXlV1z36crqDpusgD6zSFm+fFMcXMvcDpvMZuii0Cq7YN6Lyt3JzAhuXm loMRNKzEK7EexLVjKKc/OzFJjO7+W7luTRLijKmavZqarlkEwbn5/9JIpbAqoFpbu3eG gJyH9Ho7QXmv1/UCW+pdgbR00y3Uh98sI7WqvUR+m/6+f+FIUfO7Y+qcN9gyOXbqkYJI EFezncHRIlTodc/sxYNob3jxgW9AxhGuDsoPvENEjV5UGaclT9B4pbN4rGP6KpA3t8D1 TAOrlUYpT3b8kHs9lrbi65zUw8CIn+V8y6MryICMiBhQmkKyDcoM8BJT5byztr8llGuc 0atw== 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=W5DBJjOmf9pxvOTt0kEKNi/HnGT/zzejrKvVA0lijXo=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=WBuy0VnlxetINtto2SXCbGrCYWZ/23EPhiMiqPeURfAk7G2aKCGfniNlx815+KMzpb 1vLgwWm3w7n/bT8naIsxYbAsEeE6Ho7yV1bMzDyrwXeETdpio2H4HlrehM3qrBftuDCi fuNjY7A3OVTU7UFUb5DPWcFNHre0WhW07QER8zj0gPR9jlVca4BlMYUSULoSnuTPtvhB kYH8NwvrpxsbAr1yFFBPl4HBfRuw21IpbZzOPjOuTZwmVh7DJRqd3JcNKgo9y6he2kv5 3UbzyY+t1sO/3/2H9I0HEfAIsu2dBU8hKoN2SukI6N06zTdLaKyoN+PB69jqGmXoe2Jy 9jjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JFjOtUAx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32854-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id az7-20020a05620a170700b00783360f0d46si5765771qkb.302.2024.01.22.03.18.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 03:18:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JFjOtUAx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32854-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 C85DD1C21F72 for ; Mon, 22 Jan 2024 11:18:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A518481AE; Mon, 22 Jan 2024 11:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JFjOtUAx" 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 7728447F7B; Mon, 22 Jan 2024 11:05:32 +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=1705921532; cv=none; b=qH9qET9udFGZXNGjfReWVBIRUTTGJ7rLXiMMz3sFV1qS4BopJ0PXMI5VaIIkQa/BE5S+uPd0s9qLeW+Vf8kttAzuaOVIwv2+H5hKlRjw1N1R/n9X0dWCJtCfGc2mLma380dfSBoI8PP2+m+xL408oF5jZV9eojhiSbCsZC0Ta+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921532; c=relaxed/simple; bh=zD5yC++Deas+2dKKgpnZzRCfsxfjAnWJ+terllmOKSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o9yy7gjhn14JhdBrqett3NNWuTRkMn8K0BHbLiLZs1+qXBSaOoqnr+QDNoRk2ZFAq1glXV9ra3B+FdXjMcMZnDTgAym3cFNIRqS3Xmn7ut9uL8+lnGYeS7nm0ny4NshNgKK0JwblwQO1gv84G2gO+ZSVZ1y27ZiD/j89GuEYRsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JFjOtUAx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E00A4C43390; Mon, 22 Jan 2024 11:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705921532; bh=zD5yC++Deas+2dKKgpnZzRCfsxfjAnWJ+terllmOKSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFjOtUAxR1QkTNVJT/4qIzZ38cHJO1PPb6obE2SJrwvoM8I17+xK3G93dmNrzuAJB CDtCR0NEyuqgT5OquAmzN0gSoyAuv8k/ollCGPoioOlQ+UCFnK0UKFVfQoWBt4Pzir EfBbeNGnqiTDAynRnDEha572xnTi/8L9SPyzkxuwDrIw46tpccUXPTux29JhFfvBEz W5+d6GNoP56stDH6EG5Sg5CLvC5n3ORhCoP9boh8mILvphh2pFiRY+c4izgWZQYVbO ZE32ZXsgQdgjCSS08TWdYgPaIT8+bUTkfqxPa+sY/Ie5gr5zn46H4c3ujqJR7zMjvG AFn3M49lFoXyQ== 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 41/47] tty: vt: make types of screenpos() more consistent Date: Mon, 22 Jan 2024 12:03:55 +0100 Message-ID: <20240122110401.7289-42-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 * parameter offset: it is expected to be non-negative, so switch to unsigned * return type: switch from ushort to explicit u16. This is expected on most places. And fix the remaining two places too. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/vt/vt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 4e9d689143e0..f6fa76c0eb5b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -286,12 +286,12 @@ static inline bool con_should_update(const struct vc_data *vc) return con_is_visible(vc) && !console_blanked; } -static inline unsigned short *screenpos(const struct vc_data *vc, int offset, - bool viewed) +static inline u16 *screenpos(const struct vc_data *vc, unsigned int offset, + bool viewed) { unsigned long origin = viewed ? vc->vc_visible_origin : vc->vc_origin; - return (unsigned short *)(origin + offset); + return (u16 *)(origin + offset); } static void con_putc(struct vc_data *vc, u16 ca, unsigned int y, unsigned int x) @@ -705,7 +705,7 @@ static void update_attr(struct vc_data *vc) /* Note: inverting the screen twice should revert to the original state */ void invert_screen(struct vc_data *vc, int offset, int count, bool viewed) { - unsigned short *p; + u16 *p; WARN_CONSOLE_UNLOCKED(); @@ -773,8 +773,7 @@ void complement_pos(struct vc_data *vc, int offset) if (offset != -1 && offset >= 0 && offset < vc->vc_screenbuf_size) { unsigned short new; - unsigned short *p; - p = screenpos(vc, offset, true); + u16 *p = screenpos(vc, offset, true); old = scr_readw(p); new = old ^ vc->vc_complement_mask; scr_writew(new, p); -- 2.43.0