Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp885614rwb; Wed, 16 Nov 2022 08:57:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf60VFKy+jGj3VpB855VgLxQu74YTXxt0gQ2JB8Xcl46IT7f1Gi/NomqGfNlLra4TTzBqg1U X-Received: by 2002:a63:1f21:0:b0:46f:baeb:13cc with SMTP id f33-20020a631f21000000b0046fbaeb13ccmr21104711pgf.224.1668617849104; Wed, 16 Nov 2022 08:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668617849; cv=none; d=google.com; s=arc-20160816; b=FhU5P0UazXz4Ut/Oce6uRFhknAmhFf5k1jt9Bw7625uwm1SC7Dw/OVCRfHMOpvXO7P CYqDnEHOuAOdFeKfw0ZTfpG8WNUom2vyDXRNWFbBo+7iFqhDFcIEwSUTJdob2tnoSTg9 zSfgbK+APfpk0SaK0dbgkFVOnx6q6nlKl4itMYdrdtvbkpClWho3hdx5nctIhTSdtbja y9dHl0uaKbRPbN7Z2EPej4UE+BwhZ+MWoYarVwZEomxZ3RZCP6zGmwRzalT95Qqva/sL LqbRgDyz/D+U6dp62czsQ7vGI8RKAZ8v+1k+Iwl0vNyFxvnlmCPi1fLdNLI5FYE9ic79 P7sQ== 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=WoAi/IMpBqhMANDygn8dBGFjZ2GQ0xeR1eRQRwl7/a4=; b=TSIVIe1EqIleDtxkM+5UtUbVkbW2RBazLwzkAekkWjd4Aq2BO/kIuRMmV6fxau2oNT vhbGiuJTgzek1rfnrFDErzbbu6dwtPCHnEulKNoViIzF2Qamu3O3rW16Y5evq95IOMaT 1CuQiI9B87KC9rU4bRpETU80nkDY8c407+Nky7eZj+EvgCXDIfQTDjYSXYDiodOzADtX Lw2+Bh6kJixX1ZnsHqr/R4bWwFNbZMdpzsadZ4zAa9TPq8J7w7WFp/2JIXIjxDSN19c5 n9S5DdPTMHqHhbAG9gIKeRUtncFp0/naX0lUk+tu8ADcTcJ8syCApoHtU7R6yEJ2+Ht4 A+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3DQ4ybTO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020a170902d54d00b001782bd6c443si15586110plf.621.2022.11.16.08.57.17; Wed, 16 Nov 2022 08:57:29 -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=3DQ4ybTO; 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 S234423AbiKPQZA (ORCPT + 91 others); Wed, 16 Nov 2022 11:25:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234879AbiKPQWi (ORCPT ); Wed, 16 Nov 2022 11:22:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195CE56EEC for ; Wed, 16 Nov 2022 08:22:10 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615728; 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=WoAi/IMpBqhMANDygn8dBGFjZ2GQ0xeR1eRQRwl7/a4=; b=3DQ4ybTOYcFtmwITLSHIYeVyVwnAXkGWFQW/4sJDsRLNKaCHLDRnlfSlMsgSfYPJL06aU6 HObqr0W9cSaKt1dPrg88oy2FnVMdizwcMqHQh/H9lJHeqvg7UgarLJvkZW/wof37+IqYp0 PUM5sQ0uYjBDY8iSw0ByaONYCNjofDYn38xrzQcO68QqVPwBLsAzqSolO9quGnzP4IqYSL Kw7JHvV4ZuZra98V5OSvbL4vcRlGBWHVUS9pmiBj7zVX8jdPOPuJHOJ0O0mq2VO3o03dXo bvMpC71N/uhuEhtU7QQaUNzrCbgtikuD2C5DSalmb+Zl1yXI7vuDI9zlf/D9Bg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615728; 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=WoAi/IMpBqhMANDygn8dBGFjZ2GQ0xeR1eRQRwl7/a4=; b=BAcrakEpk8MQUdoOPQfpxF5sGvK4lMHn3g/fTME1TCNLAdTunomPlI5CyDW0olh1v3Kiq5 +U26bZuftwKQNSBw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linuxppc-dev@lists.ozlabs.org Subject: [PATCH printk v5 25/40] tty: hvc: use console_is_registered() Date: Wed, 16 Nov 2022 17:27:37 +0106 Message-Id: <20221116162152.193147-26-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: 8bit 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 It is not reliable to check for CON_ENABLED in order to identify if a console is registered. Use console_is_registered() instead. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- drivers/tty/hvc/hvc_console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 4802cfaa107f..a683e21df19c 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -264,8 +264,8 @@ static void hvc_port_destruct(struct tty_port *port) static void hvc_check_console(int index) { - /* Already enabled, bail out */ - if (hvc_console.flags & CON_ENABLED) + /* Already registered, bail out */ + if (console_is_registered(&hvc_console)) return; /* If this index is what the user requested, then register -- 2.30.2