Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1941174rwb; Mon, 7 Nov 2022 07:27:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM6wOwN9wzV1zG9Cs96xd/P58EbAWA8Osu1mXV4+45v/49sn9aepeY3eVXyKvRBlcyo2Vy8f X-Received: by 2002:aa7:cf83:0:b0:463:1b7d:e318 with SMTP id z3-20020aa7cf83000000b004631b7de318mr45591288edx.4.1667834836740; Mon, 07 Nov 2022 07:27:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667834836; cv=none; d=google.com; s=arc-20160816; b=guiqTAdXwdS7T3I/kdfcXASuEkHtnSB/P+uXlT30kU68b8+I6+J9t5x4BycTMbnTgD qZPZa1NbAHkG0TeInzhVYDZvoJQsXKkVrNzVyqHmH1aVdYXmWuGbCjHiarn9vbPJ/70u x5l60ZZmOv5cjqeHzL3FgNiSKJiHtj/TbNgR043hJL0EYNzOof4ybOnNLaZBH4nxJ/Cn KCtc5bd5wY/upqBYfLwNTEC5HNFkdXpSUzotNTWzsc1PNeT3s9PNWA8P28ylALq9b9cK Lb/M+/bqzf5XgwQ+IQXLoSil2HDPUcIEhfhQXSlxorObLVLDaLElBWYYPd8eSmhgBDry 27bQ== 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=kStKa0WjYDeKLxGc8aWMlTa8ztLKd7SaO/mrohxpQTE=; b=oJWjkunKgqC81MMHWNxlt7rJKMnKYnW28NzEfjlh1LuHw3OnTtNlout2GzvS48tehK XgvLT3qsr9qEWxG8C1zs8re0lwoQ4NU2CD2uRyGF/IVjuVMoPVhv6kBQm5RjBEGBOhMd eDch2usMu2G3iT/JYMRfh5NDOr0jk4ZyfZ6JxB462E5MqH2P34X83dITi2FIbiyDV31N 0r0vxxjxsqiBoIg4OgZBnF7VltzTSr7TSIGxWboeVOAGiJz0oRnoNGyvDsD2l50se2ce 0bKpZSypb6TDr+8KESbfmTr0rwFzJwUCkjFDPmXhJk+COJeCW/k+RdlW0ntzILIOEsWG HnTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="pz/gQ/1s"; 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 c4-20020a170906170400b007ada2efa6b7si7268735eje.567.2022.11.07.07.26.51; Mon, 07 Nov 2022 07:27:16 -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="pz/gQ/1s"; 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 S232369AbiKGOS0 (ORCPT + 93 others); Mon, 7 Nov 2022 09:18:26 -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 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 --- 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