Message ID | 20221116162152.193147-27-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp233486wru; Wed, 16 Nov 2022 08:25:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6SEXjSSeqX77litoR019Z5UIUE3vsjhUi+Cor4vnuLm7Vny9Pr3IBnii9w2dgOP2iY2fL4 X-Received: by 2002:a17:90a:5d8f:b0:213:aa8:dda with SMTP id t15-20020a17090a5d8f00b002130aa80ddamr4609596pji.111.1668615957833; Wed, 16 Nov 2022 08:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615957; cv=none; d=google.com; s=arc-20160816; b=HxOdgEOG3jmTaCFq+puve+/gKJ0dcVA1//4kUTfkrbvlAZZNDNqCipxpEtuXIg2h/R 0iKcBRlL0qk0XSF2DdufefsVmZxSqCHyIk9QgPUXl3M47HOjMz23UA1c7kvqtY70QFXB /LhBc+z9t51PaGEdDGBVAVsvisCmMJrSJPm7fWo/BL49blflPoafZLuOIzcG5swLPiQU qUu4P8szjGIGnrDdPvs3vv7o1YZnXRXK23R/fGvKrK3St1jVhPGoyhmM79+73zGY/CEG +EmAhxMlU54OEYoKZd/RfPf8lgQKO0LLAna/nzM136nyjwtqNgnOKQ3kqtCH6p53QURZ K34A== 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=6hf4u/s4+AojpME8OJwmFCYo46PpjYxYo+DIhKotoZ0=; b=ew8DJtt4agDQGl54uK/wPozgaWcaX12vEQLaTOgh5r0mZb6vc5ityY+I14lhXXINY0 LITbkHYuQ33QzG24ibg3+AdS+v0mU5NbcnMgPDftOdTtDqZeMrWrIjuEGvLJzlEhkdKe Xh1De54XYu/U6aJnRzLOIQf/wkltTJ7yb9eGxkVCzjnzIBlnx9tfAcoSKhGS4xCEaila GonvwgZ4/Ub387vfh7d8iUgNVtZiqBoMSOrxqT2mcYtGT6pPdGzoaGVf3FKI8JlBJEWr USP+6xvQ2fyfw0YYwfJxqVOQCpUeNRrHF0h0MQKqlr477vAxewfXh/4Ji/ChBnchhFCM 7iuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q2qeOzzI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=9tm5BNT5; 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 g14-20020a65580e000000b0046ff70b1cf3si15683972pgr.463.2022.11.16.08.25.44; Wed, 16 Nov 2022 08:25:57 -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=Q2qeOzzI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=9tm5BNT5; 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 S238876AbiKPQZK (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 11:25:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234892AbiKPQWi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); 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 8EEDC58002; Wed, 16 Nov 2022 08:22:10 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668615729; 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=6hf4u/s4+AojpME8OJwmFCYo46PpjYxYo+DIhKotoZ0=; b=Q2qeOzzILKPeM4Fxhi7r+Gq3cQ9jsmx9lGVYfDR+fWfGhaFfr8vPWZU5AC5raFSFI/LRBA 6wpD/myRS0aIc+52+F4YdG1NGnuklXCsd9q4HAz4KM6D2UV/Qg5qo98SlFEOPLH3voeZJm g3zwpeTHvWz/+uO1Y0NYaWoiOAGYMKIRESt+fWNVYxwXCYV9D7yyZ+aA9dK3AfsIXz5UXV iZgU/RIRTXfQwttH8CJyoW1syhCUQIIq3ZAUNbBNx6wkhfpLB5pPR4tui2BTXbg428HM7R /Jlj1K86Tpu7g2BM+LQhtVZfiyc90H1FbW51PbngNGRQ4TTR4o5p6MeB2yVllg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668615729; 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=6hf4u/s4+AojpME8OJwmFCYo46PpjYxYo+DIhKotoZ0=; b=9tm5BNT5j4GwYhklIDEkUD/Np15mgjT+9v3F//XA1pRocGB74UMrUCC3bDkAUA3wY9wRpJ LUSB57yO9g6sRrDg== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, linux-serial@vger.kernel.org Subject: [PATCH printk v5 26/40] tty: serial: earlycon: use console_is_registered() Date: Wed, 16 Nov 2022 17:27:38 +0106 Message-Id: <20221116162152.193147-27-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749670646420690935?= X-GMAIL-MSGID: =?utf-8?q?1749670646420690935?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 16, 2022, 4:21 p.m. UTC
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 <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> --- drivers/tty/serial/earlycon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index a5f380584cda..4f6e9bf57169 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -181,7 +181,7 @@ int __init setup_earlycon(char *buf) if (!buf || !buf[0]) return -EINVAL; - if (early_con.flags & CON_ENABLED) + if (console_is_registered(&early_con)) return -EALREADY; again: @@ -253,7 +253,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match, bool big_endian; u64 addr; - if (early_con.flags & CON_ENABLED) + if (console_is_registered(&early_con)) return -EALREADY; spin_lock_init(&port->lock);