From mboxrd@z Thu Jan 1 00:00:00 1970 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 827411C5F28 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=1743115474; cv=none; b=WegwH1yo3vGKArXKfGb1AmPIh509azsVLfEc3d76ul211soivFmpK4jiP5roSfHsWQmfe4cAkqVWXGzdLrO6nQVKr1KQ6BeVonMuNYgGBp5doRnhG+PYEqZnj+HcJWWkqLJH0T7+OcauCqNfHp/LYc1WNTPgaJPowlv4q2L/0W0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743115474; c=relaxed/simple; bh=yKteizhK25k+Kq3y52vY08el1oFVEAXgw0e0maVMvA8=; h=To:Cc:Message-ID:In-Reply-To:References:From:Subject:Date; b=ACAwGo+N3yIemhPRxNLd6Jodsln+eqGorWlrQ0w64GoVT0cUO7AGdErXBo/QUKZvaR+Zgv0x1RkfPsTMskCBIBXYKWw8kizl6j/4EqmuFcHTrmcR1hSZg2r8Pwm/hXD4lDXB+LPM/vVYr7+ro9Kt6bCQoWAm/5TvI/Uihdp/V5s= 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-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 --- 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) + 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) - /* 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 */ - 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 -- 2.45.3