From nobody Wed Dec 17 07:06:07 2025 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (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 ABC441C5F28; Thu, 27 Mar 2025 22:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115458; cv=none; b=HcL8cZ4oeDt/wwb6WZsrjUiEtO1/sZzhd+hhAMCkeCdwvVIvKI8a8nsCxQMm4/Y/LSmoATishYNySvfRYnCCinSToFr8CVVEwKvsNmR+QoNUTxqgqL1pTHsKrj4vnVqYZFNQMtLU0RqWNo2AplgPN5sOqNq/Q7K/sr0R8+WeYaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115458; c=relaxed/simple; bh=uDqOaJetGvod+fFPZoCuGHoVSiv3OCbqbKddMAQJdD0=; h=To:Cc:Message-ID:In-Reply-To:References:From:Subject:Date; b=C9LZenqf23jXKJSAtjua+OwsPqaqGDG1SdkeELPVntwJhSdmqlIqF0lXV95RYOUhb2Oqhs29v3j48QtzPiXJgJdJA1YuWcjNMiWvHY0nM+MhFxC6gRlHfybGnpMsSQ4e+l9cdo4vfy6o0Ls+6gi0D/NOKtIKkOuwnbCpJ2jlfvg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=xhRmDhA1; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="xhRmDhA1" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8A3AF25401E2; Thu, 27 Mar 2025 18:44:15 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Thu, 27 Mar 2025 18:44:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1743115455; x= 1743201855; bh=YoAucZtCMma1lcxFqynERyIEZTTs6k89qEgRCI1eRF8=; b=x hRmDhA1XbqLGzFjp3iYED1HNSZm8Sac5HEDbBkaQL0O/Vd7gM38W4xEjgcK8rD/e DuhIAk9DVEvhvfL2By6IBRw4PdJWwB/lY7W7GhGBouCc1IteC7Go3DtBtnr274do 3gKHpEzScMA6Qyx919rVmVRMIP3vWtH+lhyTNPi9OwlhBJSXcXbq+vJcDQxqU+zC MHXikLwoUOLq4Xr99zHuokCQcldbWUHmhh3+vQJdknrNvpBIRqqLIvIPB6cYvU9r beennl7R31FDiO3CTElhrXRhqxB8hHYHySS1QXSLSHHCTcscMWE8TY/ulN5svC9H 9k8xRIgNweROWeFyMMXrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieelieehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepvfevkfgjfhfhufffsedttdertddttddtnecu hfhrohhmpefhihhnnhcuvfhhrghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrd horhhgqeenucggtffrrghtthgvrhhnpeelgefhvefgveduhefffeeuveehtdeigedukeef uddvhedvfefhkedugffffeetheenucffohhmrghinhephhgvrggurdhssgenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrghinheslhhi nhhugidqmheikehkrdhorhhgpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehgvggvrhhtsehlihhnuhigqdhmieekkhdrohhrghdprhgtphht thhopehlihhnuhigqdhmieekkheslhhishhtshdrlhhinhhugidqmheikehkrdhorhhgpd hrtghpthhtohepshhtrggslhgvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht oheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpth htohepshgthhifrggssehlihhnuhigqdhmieekkhdrohhrgh X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Mar 2025 18:44:14 -0400 (EDT) To: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Schwab Message-ID: <9d4e8c68a456d5f2bc254ac6f87a472d066ebd5e.1743115195.git.fthain@linux-m68k.org> In-Reply-To: References: From: Finn Thain Subject: [PATCH v3 1/3] m68k: Fix lost column on framebuffer debug console Date: Fri, 28 Mar 2025 09:39:55 +1100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move the cursor position rightward after rendering the character, not before. This avoids complications that arise when the recursive console_putc call has to wrap the line and/or scroll the display. This also fixes the linewrap bug that crops off the rightmost column. When the cursor is at the bottom of the display, a linefeed will not move the cursor position further downward. Instead, the display scrolls upward. Avoid the repeated add/subtract sequence by way of a single subtraction at the initialization of console_struct_num_rows. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Tested-by: Stan Johnson --- Changed since v2: - addil and subil are now addql and subql resp. --- arch/m68k/kernel/head.S | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 852255cf60de..9bd8adaa756d 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -3400,6 +3400,7 @@ L(console_clear_loop): =20 movel %d4,%d1 /* screen height in pixels */ divul %a0@(FONT_DESC_HEIGHT),%d1 /* d1 =3D max num rows */ + subql #1,%d1 /* row range is 0 to num - 1 */ =20 movel %d0,%a2@(Lconsole_struct_num_columns) movel %d1,%a2@(Lconsole_struct_num_rows) @@ -3546,15 +3547,14 @@ func_start console_putc,%a0/%a1/%d0-%d7 cmpib #10,%d7 jne L(console_not_lf) movel %a0@(Lconsole_struct_cur_row),%d0 - addil #1,%d0 - movel %d0,%a0@(Lconsole_struct_cur_row) movel %a0@(Lconsole_struct_num_rows),%d1 cmpl %d1,%d0 jcs 1f - subil #1,%d0 - movel %d0,%a0@(Lconsole_struct_cur_row) console_scroll + jra L(console_exit) 1: + addql #1,%d0 + movel %d0,%a0@(Lconsole_struct_cur_row) jra L(console_exit) =20 L(console_not_lf): @@ -3581,12 +3581,6 @@ L(console_not_cr): */ L(console_not_home): movel %a0@(Lconsole_struct_cur_column),%d0 - addql #1,%a0@(Lconsole_struct_cur_column) - movel %a0@(Lconsole_struct_num_columns),%d1 - cmpl %d1,%d0 - jcs 1f - console_putc #'\n' /* recursion is OK! */ -1: movel %a0@(Lconsole_struct_cur_row),%d1 =20 /* @@ -3633,6 +3627,23 @@ L(console_do_font_scanline): addq #1,%d1 dbra %d7,L(console_read_char_scanline) =20 + /* + * Register usage in the code below: + * a0 =3D pointer to console globals + * d0 =3D cursor column + * d1 =3D cursor column limit + */ + + lea %pc@(L(console_globals)),%a0 + + movel %a0@(Lconsole_struct_cur_column),%d0 + addql #1,%d0 + movel %d0,%a0@(Lconsole_struct_cur_column) /* Update cursor pos */ + movel %a0@(Lconsole_struct_num_columns),%d1 + cmpl %d1,%d0 + jcs L(console_exit) + console_putc #'\n' /* Line wrap using tail recursion */ + L(console_exit): func_return console_putc =20 --=20 2.45.3 From nobody Wed Dec 17 07:06:07 2025 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (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 826EC15442A for ; Thu, 27 Mar 2025 22:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115476; cv=none; b=i99gvkeB3U2ataI5wUDxK5O1pc01j1KJxoVtwKmD73wd2ad5moYqyLnfoHWdGmniI3k2JCrrlIKUAKEAJF8WW6GwkoF5hl5UL1FopYluahapoV5kjL13IWnYNktkpSucX5IHfK225ZhZitFft1kKXxWRblMTnGC7dc+rZEU324g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115476; c=relaxed/simple; bh=yKteizhK25k+Kq3y52vY08el1oFVEAXgw0e0maVMvA8=; h=To:Cc:Message-ID:In-Reply-To:References:From:Subject:Date; b=pNFwel1ZNbXP0D6QjkVft0c6NHAmb+TqF3TRNjEVPr/RVR3Ae+zsydOKRCKYZ4QMUNnI9aUr9lIjgoxkKBLon3auFJZ7qemyYYBdFWopcK7R5+V2842aXnF7Wfw59duaRHVyEiDaPiz6NW5vFGxV32nQUsi/PVHH/wewwM3YA3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ko/o1Pzv; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ko/o1Pzv" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id A211C25401D8; Thu, 27 Mar 2025 18:44:32 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Thu, 27 Mar 2025 18:44:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1743115472; x= 1743201872; bh=UsmTJzPJBJCv/GLsiSaAa22KCAr+coK/iO7XuDxp8g8=; b=k o/o1PzvoCy1A44RDbmMHPXZm5VygLCAmuoXQSS3RdjDk89v57z7wMxZMWpkeLlP6 b1XnKCvx4T7C+gCk2pTEm3pAbLaiadmWe9NLvTmLshj9u0ySNqUMBJAbSHGwW0Bi 8Hv3QO0BVrikBCcTKrf3KZVjxI5tkhTc4fO7a4iizafqxtqYqlv6FPn9rsalHSIV 5KMTejYVjYbIaEEVescdPq6AGkRusd35ulsE+ZrHE0+DrJQHfh8rizswIbuY6Jwm MSJi9xFu4Wug7BD6aOuUkx4PhYLOiQy5IK4SNvCG/zLoBtJyYoH76ikuNx9C1sTa YmG6lHJNssGQle8/FUZIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieelieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepvfevkfgjfhfhufffsedttdertddttddtnecu hfhrohhmpefhihhnnhcuvfhhrghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrd horhhgqeenucggtffrrghtthgvrhhnpeelgefhvefgveduhefffeeuveehtdeigedukeef uddvhedvfefhkedugffffeetheenucffohhmrghinhephhgvrggurdhssgenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrghinheslhhi nhhugidqmheikehkrdhorhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehgvggvrhhtsehlihhnuhigqdhmieekkhdrohhrghdprhgtphht thhopehlihhnuhigqdhmieekkheslhhishhtshdrlhhinhhugidqmheikehkrdhorhhgpd hrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Mar 2025 18:44:30 -0400 (EDT) To: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-ID: In-Reply-To: References: From: Finn Thain Subject: [PATCH v3 2/3] m68k: Avoid pointless recursion in debug console rendering Date: Fri, 28 Mar 2025 09:39:55 +1100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The recursive call to console_putc to effect a carriage return is needlessly slow and complicated. Instead, just clear the column counter directly. Setup %a0 earlier to avoid a repeated comparison. Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Tested-by: Stan Johnson --- arch/m68k/kernel/head.S | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 9bd8adaa756d..49e079b0d0b5 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -3533,19 +3533,16 @@ func_start console_putc,%a0/%a1/%d0-%d7 tstl %pc@(L(console_font)) jeq L(console_exit) =20 + lea %pc@(L(console_globals)),%a0 + /* Output character in d7 on console. */ movel ARG1,%d7 cmpib #'\n',%d7 - jbne 1f + jne L(console_not_lf) =20 - /* A little safe recursion is good for the soul */ - console_putc #'\r' -1: - lea %pc@(L(console_globals)),%a0 + clrl %a0@(Lconsole_struct_cur_column) /* implicit \r */ =20 - cmpib #10,%d7 - jne L(console_not_lf) movel %a0@(Lconsole_struct_cur_row),%d0 movel %a0@(Lconsole_struct_num_rows),%d1 cmpl %d1,%d0 --=20 2.45.3 From nobody Wed Dec 17 07:06:07 2025 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (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 8844016A956 for ; Thu, 27 Mar 2025 22:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115486; cv=none; b=EhuwkVHIi8kKKiDH3Ljc6sqMsjpJeDiprG4U8Lqh0+wjxNCHsd7Ygm8MHhcbJB6k5j/6eFptF07EvFmvmlLmVsNgVI5ZYk8bwdZVhS5Srg6jfukLWZGh7PrDE5t7gdF+wY3vwZtW6rd1byZYGRC4Os04NzR9qBOrgGOvYAjb8yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115486; c=relaxed/simple; bh=EVSozXOZKV9ZpHzoCP5rGPCCzzyWRqpKuEwpvefeeD0=; h=To:Cc:Message-ID:In-Reply-To:References:From:Subject:Date; b=U8rfyeOS588JkMF1Qlj/dCGC3oWUikHtbiL7r2poYZeLn1xKMnFZuKDjf1abQVnNuDAJtrtUOqLJp7VmJ3+3bBptxMDReAKIlWdFEyqKDpGzoFLkUXVYC9DBjFPFjb2egLBAbUCxL/F8YFA9rBrH2ff7ihD+EUlXfg5Xnx3XSIw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ma7WcIpR; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ma7WcIpR" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id CD09D1140092; Thu, 27 Mar 2025 18:44:43 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 27 Mar 2025 18:44:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1743115483; x= 1743201883; bh=XgoMfS+YSJBX4lDElI2Bnf1qXuBkYAb9h/BqygdkIb4=; b=m a7WcIpRi6hc1luDamk3e6HlYCOcKnlBcP88MHtE6sMiaWpA7wV17VXEkcmAra5Gq pDZyb9ZhkyQ+7y/KFQ2rKdudLKkIOAXDR7F91XGkII2EQKoSu4zfAFRdRTQtyChs 4x4DMPQeMW9V/LMoFUG0nbv7WekZgBuTKVVu5Otk2qL3zhBGfbxadTGwLf0v5Kl/ l2xYoPokbVTdcXWNVcO7MAg071Wz4TGX6oHcxoZFAGR6UGrdwSJLDgA4uChrKdaI jcJBNT43nrtip355n1KVb0uLJFbFAAe/Y4w5SR5c0R8/8eP6Kx6mCmtfwB2EQQj+ WW1yhaCa6WAlZhJAVRSJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieelieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepvfevkfgjfhfhufffsedttdertddttddtnecu hfhrohhmpefhihhnnhcuvfhhrghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrd horhhgqeenucggtffrrghtthgvrhhnpeelgefhvefgveduhefffeeuveehtdeigedukeef uddvhedvfefhkedugffffeetheenucffohhmrghinhephhgvrggurdhssgenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrghinheslhhi nhhugidqmheikehkrdhorhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehgvggvrhhtsehlihhnuhigqdhmieekkhdrohhrghdprhgtphht thhopehlihhnuhigqdhmieekkheslhhishhtshdrlhhinhhugidqmheikehkrdhorhhgpd hrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Mar 2025 18:44:41 -0400 (EDT) To: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-ID: In-Reply-To: References: From: Finn Thain Subject: [PATCH v3 3/3] m68k: Remove unused "cursor home" code from debug console Date: Fri, 28 Mar 2025 09:39:55 +1100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The cursor home operation is unused and seems undesirable for logging. Remove it. The console_not_cr label actually means "not line feed and not carriage return either" so take the opportunity to replace it with something less confusing. Rectify some inconsistent whitespace while we're here. Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Tested-by: Stan Johnson --- arch/m68k/kernel/head.S | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 49e079b0d0b5..6465333d5f7c 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -3555,28 +3555,21 @@ func_start console_putc,%a0/%a1/%d0-%d7 jra L(console_exit) =20 L(console_not_lf): - cmpib #13,%d7 - jne L(console_not_cr) + cmpib #'\r',%d7 + jne L(console_not_lf_not_cr) clrl %a0@(Lconsole_struct_cur_column) jra L(console_exit) =20 -L(console_not_cr): - cmpib #1,%d7 - jne L(console_not_home) - clrl %a0@(Lconsole_struct_cur_row) - clrl %a0@(Lconsole_struct_cur_column) - jra L(console_exit) - -/* - * At this point we know that the %d7 character is going to be - * rendered on the screen. Register usage is - - * a0 =3D pointer to console globals - * a1 =3D font data - * d0 =3D cursor column - * d1 =3D cursor row to draw the character - * d7 =3D character number - */ -L(console_not_home): + /* + * At this point we know that the %d7 character is going to be + * rendered on the screen. Register usage is - + * a0 =3D pointer to console globals + * a1 =3D font data + * d0 =3D cursor column + * d1 =3D cursor row to draw the character + * d7 =3D character number + */ +L(console_not_lf_not_cr): movel %a0@(Lconsole_struct_cur_column),%d0 movel %a0@(Lconsole_struct_cur_row),%d1 =20 --=20 2.45.3