Message ID | 20221107141638.3790965-29-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 l7csp2079630wru; Mon, 7 Nov 2022 06:22:40 -0800 (PST) X-Google-Smtp-Source: AMsMyM5rvfyRlW6V+wkd/A++eApGNGPz9q+IHVllG9JYupc4CNGmETUyKqz6BemhRBoVRLaWDe3Z X-Received: by 2002:a05:6402:1710:b0:463:69ac:a679 with SMTP id y16-20020a056402171000b0046369aca679mr40744976edu.184.1667830960141; Mon, 07 Nov 2022 06:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830960; cv=none; d=google.com; s=arc-20160816; b=CP/Tu1fAqW9xB0SX7qSBRgQNcF4OHVMMH87oCGDCwHsWIHWuYE2dsU2vAC+u1yjMAM sukzlh4TqjqlD+CILtZ6BVbsKza/9cKmSsCbMxss54jGH9xkQ7noxuvD8gO4gBJc+Nm+ tam4ltTxlfqGILFElWAHdFXpDCUBKAOzJc+RgsslU4RlOyhcPI580nFlFZynV/9xUHWH lbFuhQ5OFtt4/rupwU4bXOyIGY8tmfCajpiPth91S7Nox04LhVTbk5ArP/qz19YkyMtU uJCvYk5iTamy6babBNRRkQtNr4Zo7hiaHzEHHNuG+UJjguVk9zRZhf7pHHhMSbQ3oYLZ OAUA== 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=4rGpLRcOY1creCvrfbqnEjYKevj7W16ctfWNljowJxQ=; b=oRVMmdC1nNomWY1sQmkc8w6kphEXy5iGliIoaFOAPWuq/2fhtnTO/z7O6V3sjQi/sq p/bcvV5S6iNhmWrRBk1onsKKgIprBT5OCEVPGDBJBd2ebsVqcvyXnOhugk88auTXwYqY cca2iqjSvl+HWWt0WYxiPbIC5mdVriYo6BPj7lRa2IOIxGiVCrx1yf3Ynbh45+bCN+PP cWWQtRHUNYDFyYi5IJEYWhwDGPSJVKfXj1YuoDhw9mXtoX0CO2MnA3E6pdg+YEay1ItP oWFds8AbW7nlVwXuopUGupcTFDjN0RHjF3zm2F6nc9rpCSNyLWmZh2P/ihnc24j77b2l ekIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vZt3kVua; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eMtcNfNi; 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 sd6-20020a170906ce2600b007aa8a5131a3si6288440ejb.181.2022.11.07.06.22.08; Mon, 07 Nov 2022 06:22:40 -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=vZt3kVua; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eMtcNfNi; 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 S232383AbiKGOSx (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:18:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiKGOQ4 (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 6260F1D307; Mon, 7 Nov 2022 06:16:54 -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=1667830613; 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=4rGpLRcOY1creCvrfbqnEjYKevj7W16ctfWNljowJxQ=; b=vZt3kVuam9R9etVm3fVrEDFZRNLO6OuUaHAFGZLCS/ARafi7y9g+tZ3JIlBY4xViYlIDUD XVgslok4nnZBYTbZ1KDUHfVATLHiT/SL4wXCc9ayaNzxG2p11l9DT1lmoXu7hWOMdXm/4Y 0T6pvnDP0vP7VuAMopEbQ5TSnXdFNYBvj4udWeynojuCdS88R+oe6dMqSs9g4sdPGpG6ix 9N+cwJPjdLZHSCou9vTvLp55ApNi5p4xygKM2NnfO78PHp2jFGdV0Hnr9x1hfTdK2hb/FG N+YPS9cFQgpiVZ7dtdl/tAKCAH/BZCVRl5uyKE9bVw44ukqfBB4KkUa/3taocQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830613; 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=4rGpLRcOY1creCvrfbqnEjYKevj7W16ctfWNljowJxQ=; b=eMtcNfNim/ymbtlno+leS1ndXvplDak5vcnkw8YUVpPhIM1oojFhJO7IXBUaMMuEQIJ3mR WGpBhCUMEGgilwAw== 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 v3 28/40] tty: serial: pic32_uart: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:26 +0106 Message-Id: <20221107141638.3790965-29-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?1748847517226875150?= X-GMAIL-MSGID: =?utf-8?q?1748847517226875150?= |
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/pic32_uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon 2022-11-07 15:22:26, 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/pic32_uart.c b/drivers/tty/serial/pic32_uart.c index 1183b2a26539..c38754d593ca 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -843,7 +843,7 @@ console_initcall(pic32_console_init); */ static int __init pic32_late_console_init(void) { - if (!(pic32_console.flags & CON_ENABLED)) + if (!console_is_registered(&pic32_console)) register_console(&pic32_console); return 0;