From nobody Tue Apr 7 22:02:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE124C433FE for ; Wed, 16 Nov 2022 16:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234591AbiKPQWV (ORCPT ); Wed, 16 Nov 2022 11:22:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233256AbiKPQWC (ORCPT ); Wed, 16 Nov 2022 11:22:02 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB6F43856 for ; Wed, 16 Nov 2022 08:22:00 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+1TqEd+pwmRnewIM2sroSQVcuwkSMDWChGspRlPqu/A=; b=qkWNZuHIxGALpO16uCXZdJ0UuvGmJmsNr20J0bzpEBue6UaxzNZCJq1PYOPHQo0mny88+2 S8iJQI1dPomnzF3jtLFK+W82WvVJ/5hbXiqaIXfnt6RQmYCU2oZn+13JOqaROuN0y0gzwG 73Gwr7hBFk25eIvHWW7261YYsJdqJiQwan8tVK933Xt79BS9E160iDOkoIB4CQlv/Kg+QY iNxy2JFmnFdBCkG2dFXomeU6qWFOMl0fsfvWQ3EFTE3YrWtDGw9SSMU8MYeN17CVgMsKu8 BAAw9WsJxFb0lK1gQAIsYG+wVMPJP8rZNV7Izm4FdgXd1XVuhXr7gRmSLjgMUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+1TqEd+pwmRnewIM2sroSQVcuwkSMDWChGspRlPqu/A=; b=7n/mofXba0q/ZMlL7TlNyX0vnqpss/9Hvmr9KIGRFCUuszM8XhWj4URUkgM6600JCmmnpJ JCyjTH3cInixUQDg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v5 04/40] printk: register_console: use "registered" for variable names Date: Wed, 16 Nov 2022 17:27:16 +0106 Message-Id: <20221116162152.193147-5-john.ogness@linutronix.de> In-Reply-To: <20221116162152.193147-1-john.ogness@linutronix.de> References: <20221116162152.193147-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The @bootcon_enabled and @realcon_enabled local variables actually represent if such console types are registered. In general there has been a confusion about enabled vs. registered. Incorrectly naming such variables promotes such confusion. Rename the variables to _registered. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 173f46a29252..3d449dfb1ed6 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3156,8 +3156,8 @@ static void try_enable_default_console(struct console= *newcon) void register_console(struct console *newcon) { struct console *con; - bool bootcon_enabled =3D false; - bool realcon_enabled =3D false; + bool bootcon_registered =3D false; + bool realcon_registered =3D false; int err; =20 for_each_console(con) { @@ -3168,13 +3168,13 @@ void register_console(struct console *newcon) =20 for_each_console(con) { if (con->flags & CON_BOOT) - bootcon_enabled =3D true; + bootcon_registered =3D true; else - realcon_enabled =3D true; + realcon_registered =3D true; } =20 /* Do not register boot consoles when there already is a real one. */ - if (newcon->flags & CON_BOOT && realcon_enabled) { + if ((newcon->flags & CON_BOOT) && realcon_registered) { pr_info("Too late to register bootconsole %s%d\n", newcon->name, newcon->index); return; @@ -3216,7 +3216,7 @@ void register_console(struct console *newcon) * the real console are the same physical device, it's annoying to * see the beginning boot messages twice */ - if (bootcon_enabled && + if (bootcon_registered && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) =3D=3D CON_CONSDEV)) { newcon->flags &=3D ~CON_PRINTBUFFER; } @@ -3268,7 +3268,7 @@ void register_console(struct console *newcon) * went to the bootconsole (that they do not see on the real console) */ con_printk(KERN_INFO, newcon, "enabled\n"); - if (bootcon_enabled && + if (bootcon_registered && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) =3D=3D CON_CONSDEV) && !keep_bootcon) { struct hlist_node *tmp; --=20 2.30.2