From patchwork Mon Nov 14 16:28:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 19879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2237743wru; Mon, 14 Nov 2022 08:30:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BXNNMWJq8+OReX+1j/ScY84VUJBoj2C8hrLZqnXoPxZ3JoE2Jw1iDZlnt7DqGMtChUUM1 X-Received: by 2002:a63:4c60:0:b0:45e:4fd8:d966 with SMTP id m32-20020a634c60000000b0045e4fd8d966mr12201730pgl.100.1668443443616; Mon, 14 Nov 2022 08:30:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443443; cv=none; d=google.com; s=arc-20160816; b=De8NMo/QUbQZ3xvjUWklg9Nx4Xrp+iAId7N2vpNHP7G9ogJeF/9KaRhs53qYtri2gm To9JSsNM3ORarCgPYpFRJKPbSd7wKpvU9TQFGvL/dSGUmAaXkaXKUiD2l2wIXJWSmGUr Ez6T6X3SLwivy3XpKYeEI+7nOqBgUb8vTSfCqlKb9pAmowoybtcZTe2W5tTi1Ptusrhr O85NThKLb97J1sCawBj8OvPvNjZNn50W1K02p5kIhzbuMeRlpbsTo03N1YYJLX+Nsq84 poc1DgSBcB2U7qfiZHg3sX7WteOwwqC8D94VW8SqrV7AEzm7lZc8RKWNgi8ABexEqT9b ACpw== 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=pEuSpcGiXYy1rNkif2p1RcLRxWAuPnhCpMJ3boeNpjg=; b=EznnLzTsxLh+qgamgCSLOV3TWZodVFMhgAvEgx+7yKRtDC3SSR9wQxjagzMChQJ9AU hSeMb9heIqiEPImJoiyaJg7CaYbujoi0Uv+m+07zw0jfTxH+TX+24vuDoBn/KkbmZ9sD tueupV8OPNoYWXul8GXz0+jGHec+88xdg7THGUMAACsxTq6tq4InuVofRLLDzNKSYSkw f/hwXcu2KcXGOYs/XnkzXOk6Ab8nIddVjT6G5pF0692IzeunaQX0yaWkCctb+LNC1LU4 x9B0kzLRbDG0YzZ5syWpX+ujuhSLzavGe91a/n7Se2ntNXaio5RzCv2Ix0EQbvHKzEuj bX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="N/bsqRck"; 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 a5-20020a63e845000000b0045837277570si9745409pgk.286.2022.11.14.08.30.17; Mon, 14 Nov 2022 08:30:43 -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="N/bsqRck"; 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 S237577AbiKNQ34 (ORCPT + 99 others); Mon, 14 Nov 2022 11:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237441AbiKNQ3i (ORCPT ); Mon, 14 Nov 2022 11:29:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B037810AC for ; Mon, 14 Nov 2022 08:29:37 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668443376; 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=pEuSpcGiXYy1rNkif2p1RcLRxWAuPnhCpMJ3boeNpjg=; b=N/bsqRcka6hlDrx/SlwGRNAsEbFEBXRjQwbdRoXt4hlze32AZsQt/rhmkNMken4IpcG54I +KvWEBHaer8/Gei53H6l+GCecFD4I7gidtMF6CWblJihnzxQzE5DwB42jQlbFiI1d7JifO hFuuAyVPpFY967KrUNNJmdGq8x356zKRjK8THEwPyuHhFB2E7udRjbXnkVyFPxcQxw1HqS B124lIIlpqwf3zgW5+iBRgUIoTHePgLGxtl5xlRRnuNpgcLJeXVGdEkcps40nCTPWHz7+L /hurUZ2DPWtDUY2bh67wq39C+NuG0oiArgS1VEasLsceGezG9sOlOXjveNMh1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668443376; 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=pEuSpcGiXYy1rNkif2p1RcLRxWAuPnhCpMJ3boeNpjg=; b=rsJm1DNOHkXtPr/zx3jxXiVx0pONhvzTAgITQSLoTexSWFuCX4rsVZoPheeJfALDD322mU Ob7/pqdT1WRODLCA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v4 04/39] printk: register_console: use "registered" for variable names Date: Mon, 14 Nov 2022 17:34:57 +0106 Message-Id: <20221114162932.141883-5-john.ogness@linutronix.de> In-Reply-To: <20221114162932.141883-1-john.ogness@linutronix.de> References: <20221114162932.141883-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?1749489752178757486?= X-GMAIL-MSGID: =?utf-8?q?1749489752178757486?= 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;