From patchwork Wed Nov 16 16:21:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 21137 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp232293wru; Wed, 16 Nov 2022 08:23:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5JCEnv2k5xr9gt43t6C5fPvPHRsWkEN/BgvFST0cBa58QPT9ymI4chHhI2O80ju169VM6Q X-Received: by 2002:aa7:88c7:0:b0:561:c694:80b with SMTP id k7-20020aa788c7000000b00561c694080bmr23787578pff.47.1668615801144; Wed, 16 Nov 2022 08:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615801; cv=none; d=google.com; s=arc-20160816; b=DSsgJDNpNXzGONT3LQp12C63apmDilNFYlrEw6qcDiwDE8PO1vfXKVozHb2eJr2p7W 8XdTmgERejwg2jeQmNmDGLIRQ8OOZ/zPlRG7BziPpFYQMwWCI1c5USPUBVVkdbSEHbUa 63XUKH77KqpMZnZTPhGJ9z9iiQlC7G3Ge1Ex3aPX3+jtlu40Apn+1pAGzEGGrck5RnNb Neaux6EZhJqxD7LdYNCTGxrws/U4s13n3FUkhSIE2WRR9WTfZyj5RSGjFDCzsE/UhTf7 SM0HTytGC7UPbo/0qsvGsTtImRhZcfErzMkxIPCQgQT9AVQ0THzU+jubgpKNeTvTeKjS GNoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=+1TqEd+pwmRnewIM2sroSQVcuwkSMDWChGspRlPqu/A=; b=oFcZqi8KLCILyV5qJ3HUMpsItdNRnUT6WV2TFrbXD4JPLpJG8QeeMQ0Co1Rx2pXPib rwiKzVCQlAZXLcuvTRIMYiPNeRvLetkaWAxiPeh6BqskQV32nfLITb4tCXt6JVVSWNcp uKuGOaY15i0TRMKHEAQsj1XbenepW51m6Aptn8zSjtCUSZReM6Fv/BA37+9GTASXyY2S zPySEOCBhr/wDOISHfTrGI+0r5MxMdayJU6s+wsuja9b3TFCQ+n99CUQSg1syu7WuOdI 1cdOhAiFCKNuF+vTN5JLT+Dy1SpYh+Ehuse4TPFRtg9oS++paNWLU70k3v8/Ur4CT+Hj jogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qkWNZuHI; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a635c4d000000b00476dd604aa8si3205710pgm.767.2022.11.16.08.23.07; Wed, 16 Nov 2022 08:23:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qkWNZuHI; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234583AbiKPQWU (ORCPT + 99 others); Wed, 16 Nov 2022 11:22:20 -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 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749670482037359972?= X-GMAIL-MSGID: =?utf-8?q?1749670482037359972?= 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 = false; - bool realcon_enabled = false; + bool bootcon_registered = false; + bool realcon_registered = false; int err; for_each_console(con) { @@ -3168,13 +3168,13 @@ void register_console(struct console *newcon) for_each_console(con) { if (con->flags & CON_BOOT) - bootcon_enabled = true; + bootcon_registered = true; else - realcon_enabled = true; + realcon_registered = true; } /* 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)) == CON_CONSDEV)) { newcon->flags &= ~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)) == CON_CONSDEV) && !keep_bootcon) { struct hlist_node *tmp;