From nobody Mon Apr 13 16:58:10 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 4C377C4332F for ; Mon, 14 Nov 2022 16:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237781AbiKNQbK (ORCPT ); Mon, 14 Nov 2022 11:31:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237632AbiKNQaZ (ORCPT ); Mon, 14 Nov 2022 11:30:25 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC3B1F2CB for ; Mon, 14 Nov 2022 08:29:45 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668443384; 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=AqUN9haBzsP/HqmGWn7LninVTZwjqkkysLnOs9sIGh9FQdeeoKz7Gzt8aR3TUbQRR01ZD0 4fbSxfS2xwqbCSk4MGPZ/h9nKiWaZCjsUIYMtNaGYmCBLCtSYOMuMh/nWAMO/VbVximvSY qhW7QXGBolQdpr6mlObUNHsK8ptW93CSvfm/UHosiEe1R7oHb4NKrx2oEcBhHONoCsUtip WtYNXCCYjG94gDQtWriUL2ugK+/1sNbhHMGID8IONHOaIp2MmkGweRmUbLmExqlun3O0/3 16w4tC2pTh/0J4jTDAOoYO6LCO0OnMhXfiIRwUwS9CBL567Glz7vkU5qaYTNSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668443384; 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=mZitRJc9FS7M35SEGDgcrp6yBIpx7ZU+LTSfluPEhBlQEioB3RYMPItGTx/ey2cplmPiur 1rbpiEy4260r+8BA== 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 v4 24/39] tty: hvc: use console_is_registered() Date: Mon, 14 Nov 2022 17:35:17 +0106 Message-Id: <20221114162932.141883-25-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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) =20 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; =20 /* If this index is what the user requested, then register --=20 2.30.2