Message ID | 20221107141638.3790965-31-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 l7csp2079823wru; Mon, 7 Nov 2022 06:22:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM7vb6dHm4H5XbEOfKJSIuVR1q510zGfOKu141U53LMI3Zh9zPv5IRmlwX4cJrVoCPySDtxI X-Received: by 2002:a05:6402:1ccd:b0:459:aa70:9e12 with SMTP id ds13-20020a0564021ccd00b00459aa709e12mr50448610edb.206.1667830979316; Mon, 07 Nov 2022 06:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830979; cv=none; d=google.com; s=arc-20160816; b=UNmginfkX58llNL/9zrXcDRBduuD4xg7RugFuaUtCgGsBKznvr1NIau/KsRomvl6sf CIPCMelRL/YWyc0XANeXT3geFGGEIKNfBzFYzz+BvjI4/bMl+x8wZarg06h3jXHRGhqi ndPBpR79NOM+Q+IEOfXs4by3yYErD4A1znK19ClrM78gHkDmw5D+ywyuhKe7KyYlTBN1 bnb0/W3tbjs1TbC2yy1TlEj7UVrIvj2MKdjbKmG3voZ+FXum4RChgVqBq8w6Ux1NSbjB RZGGV3dajonqpItXo1BC/6Grmins8pWDCAWXjIHA3o9noDne31oGSoZtcyk+57jfzR4G bjYw== 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=yx/DFCpNBgX6OWBk9yiOlgcjm4ySqR68jcfyCdumqVE=; b=xOMeDIPzFIZz5K8eQyLzRbuspTBCvvCgC/QdYQ4q5gQrXfDjnxYfICKJmB4aoGshJN +PbRNpdo1bsWPwvgAOj5ZZXGlooycHaoH1Qo1iwkzlTkUZqha6AQkiDvhFwgiE4VcE6G XcHlUdXK+yvokvHVbi899Eoik8HeoGWwGkzfHTvt86vvs1dxxk4P036tQw+bi3SVvB9K Twl0o0FwlRf7r3C7+iTO+eE76ZYYdExojyg/El8Sc/TqBta60ZrmyulUuuBwB09CoMzF XUPnaeksT4bhuq2kd5MDMAbZB31YFG9GzhtX0ke7lHNrTO2Eowh+rAhaLdvN29yzo06G 5heQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RwsDLfjO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 m22-20020a056402431600b0045d03c18e5bsi11582229edc.560.2022.11.07.06.22.34; Mon, 07 Nov 2022 06:22:59 -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=RwsDLfjO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S232398AbiKGOTA (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:19:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbiKGOQ4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 09:16:56 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688871BE94; Mon, 7 Nov 2022 06:16:55 -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=1667830614; 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=yx/DFCpNBgX6OWBk9yiOlgcjm4ySqR68jcfyCdumqVE=; b=RwsDLfjO6P/9jgKRgz3idn17Rse6DcJyvmEF99pKAn+m89IIv/rL+ewmMLnsbzlze/PPhf xbhN7RALZQjSju4ionne5siq/3B+wVv/dHr7EQe72v/ahvzE6lPGATLVQ5v/cCBWiDrH1R N9ymsPzyrfVCeWZtinJg4mkwATpsOqGeq2f40LfKS7EVBNu9aPuOrGf1TwrfO7BlKUG7da yNtoEDcVs5XBVWJslZaGkeDa7mgggQ+GLzypRERytrX4KoHPipjBDeMy14tJjapPYrdVFF ZLed3exlDX2omJt6OHNDpbt0CfL4AAHGj2VL1sQQs4bzLP+ctkVWJtqLtsBJkQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830614; 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=yx/DFCpNBgX6OWBk9yiOlgcjm4ySqR68jcfyCdumqVE=; b=KiZOPxkkpXsT1r8oIQ23HB7CG/MNqWqgZoYb11rwfEFel9/QBfZxbw/TR1RrKjqA95BbDo WF8ujwxtqJiGpPCA== 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>, Michal Simek <michal.simek@xilinx.com>, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH printk v3 30/40] tty: serial: xilinx_uartps: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:28 +0106 Message-Id: <20221107141638.3790965-31-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: <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?1748847537019222556?= X-GMAIL-MSGID: =?utf-8?q?1748847537019222556?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 7, 2022, 2:16 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>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon 2022-11-07 15:22:28, John Ogness wrote: > 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> Best Regards, Petr
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 2eff7cff57c4..0cbd1892c53b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1631,7 +1631,7 @@ static int cdns_uart_probe(struct platform_device *pdev) #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE /* This is not port which is used for console that's why clean it up */ if (console_port == port && - !(cdns_uart_uart_driver.cons->flags & CON_ENABLED)) { + !console_is_registered(cdns_uart_uart_driver.cons)) { console_port = NULL; cdns_uart_console.index = -1; }