From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3EEFC43217 for ; Mon, 7 Nov 2022 14:17:51 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N5YGj5jS2z3dv8 for ; Tue, 8 Nov 2022 01:17:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=pz/gQ/1s; dkim=fail reason="signature verification failed" header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=l5i2HOU0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=193.142.43.55; helo=galois.linutronix.de; envelope-from=john.ogness@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=pz/gQ/1s; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=l5i2HOU0; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4N5YFh37wNz2yRV for ; Tue, 8 Nov 2022 01:16:56 +1100 (AEDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830612; 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=kStKa0WjYDeKLxGc8aWMlTa8ztLKd7SaO/mrohxpQTE=; b=pz/gQ/1sVexBvgNtGDYjCRgwbJbEvU2eH4YV9pYimdcqvWP2I+B1duvHeKAbgYv5Lr07fJ 3nSzyHqOLORAovjTQxpM5UWGC5xmpELupKsgitL24XB/k/6CbYqbdrByQjGVG32ntimIJ1 USj7SHbao60ntXl7F0B8/Dgf2I0ETZl2HOE6SvWVzvw6syMMJ7jkBNFcCqtzk2ci0rb/h/ nzelv8Zhcyl2iQtUuncRNBpI6lOSso410y4Bkv7m8+4KFJrOnAiON98KbP8i6OKblxuMiU 1Npm/OYCrsXehm0v8UpG8OKzvnQOtYRcwsNbXQ+4ALpv4hu7eoaYI7SzAqD/Bw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830612; 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=kStKa0WjYDeKLxGc8aWMlTa8ztLKd7SaO/mrohxpQTE=; b=l5i2HOU0W5lz3c3aPgWHXD4IoEYHwPnmVudjTMsP1yxWvp9K9lwAxVDh5Sa/IY4JgVQe+k TL9RD2dZn3zPqhDg== To: Petr Mladek Subject: [PATCH printk v3 26/40] tty: hvc: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:24 +0106 Message-Id: <20221107141638.3790965-27-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Steven Rostedt , Sergey Senozhatsky , Thomas Gleixner , Jiri Slaby Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 EE249C43217 for ; Mon, 7 Nov 2022 14:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231693AbiKGOS2 (ORCPT ); Mon, 7 Nov 2022 09:18:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232217AbiKGOQy (ORCPT ); Mon, 7 Nov 2022 09:16:54 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B541CFF1 for ; Mon, 7 Nov 2022 06:16:53 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830612; 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=kStKa0WjYDeKLxGc8aWMlTa8ztLKd7SaO/mrohxpQTE=; b=pz/gQ/1sVexBvgNtGDYjCRgwbJbEvU2eH4YV9pYimdcqvWP2I+B1duvHeKAbgYv5Lr07fJ 3nSzyHqOLORAovjTQxpM5UWGC5xmpELupKsgitL24XB/k/6CbYqbdrByQjGVG32ntimIJ1 USj7SHbao60ntXl7F0B8/Dgf2I0ETZl2HOE6SvWVzvw6syMMJ7jkBNFcCqtzk2ci0rb/h/ nzelv8Zhcyl2iQtUuncRNBpI6lOSso410y4Bkv7m8+4KFJrOnAiON98KbP8i6OKblxuMiU 1Npm/OYCrsXehm0v8UpG8OKzvnQOtYRcwsNbXQ+4ALpv4hu7eoaYI7SzAqD/Bw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830612; 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=kStKa0WjYDeKLxGc8aWMlTa8ztLKd7SaO/mrohxpQTE=; b=l5i2HOU0W5lz3c3aPgWHXD4IoEYHwPnmVudjTMsP1yxWvp9K9lwAxVDh5Sa/IY4JgVQe+k TL9RD2dZn3zPqhDg== 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 v3 26/40] tty: hvc: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:24 +0106 Message-Id: <20221107141638.3790965-27-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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