Message ID | 20221107141638.3790965-32-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 l7csp2078726wru; Mon, 7 Nov 2022 06:21:02 -0800 (PST) X-Google-Smtp-Source: AMsMyM6gkk7NW8NO7WTnziJ7yQOtChx5spKo7XtFH3WsBrKDx3ClV2MFI7qCQEqldPrLQ9ECp+qu X-Received: by 2002:a05:6402:d0b:b0:458:a244:4e99 with SMTP id eb11-20020a0564020d0b00b00458a2444e99mr50879728edb.46.1667830862569; Mon, 07 Nov 2022 06:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830862; cv=none; d=google.com; s=arc-20160816; b=VG9yDBHiJPzlZuGjy1ymhA3wxUsr1ujWzMjmZqW4BU8XgVITVnVgDQlTSHt8kDpCK+ QEdQYL+1fGN9bTJH56A0qGOQuL7U1DheOhsFXDGCQ1OQRb/MwH3sb8ENtmpdkiSCO6qS C/WBE8nrg5YWgD3tozEY3pB9gKI0Q2Bdp+eEVMzm7f0Zvc1GxGT16TYpLdsLY9pUYk+f g2x3hZt/byNtDDSsr/8p/JFhjNhnVNHHjHykbkL6qwKo5IeuBp5MgX8hZgqK3zP0AOj6 pHbVpC3gf3trrKC+t23oHBLffnYHQlR/mrYwOUMyabG3S1ZQMrGWCijmg7Z6STsvsTMo 7prA== 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=ihos3kVL43GcNnwvRQa8EAkart8aw0DgSI6lBkWbDJU=; b=P10TJPbg68YDEXoOUqzWZ7KHPqodrJaA+f/MK/G+CxEJKKjS6uqi9Ze2Qq0li5tgV3 780yQ1cJADE4osBsh2h6GGbqMOYdH9Hd/yqnjiWpT/g+Lz5C91n22MBLx4SHjcWmGX9q fWnkuMuxZxBqi/WcASB7e768XTKmrUrY7MLvmMsA1w77eGaRMePx/KdF5Wmi6v28KdSJ 6FN3QlVCJa+OqkIbWRky47fwkeEYVJfmBFRlbwPn8HLitR2YTJvIRQZBS16+u90gxt7x O7R4kfiOfxZccHHQyp2cUuiWZkGrERg3AmpOEkk5Dtuban2dlVZQs6dhnqDpYINVIVLl IkXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DuF+bg8y; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a056402270800b00457f31c1a10si10565673edd.584.2022.11.07.06.20.34; Mon, 07 Nov 2022 06:21:02 -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=DuF+bg8y; 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 S232426AbiKGOTJ (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:19:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbiKGORR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 09:17:17 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E96F21D0DE; 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=ihos3kVL43GcNnwvRQa8EAkart8aw0DgSI6lBkWbDJU=; b=DuF+bg8yJFtPqiLv6Lzgpcy64Jm33Cwtcx+KWAV2sOjl/URNXsG3YczPD3PcntqIncaoNm 3L02VXPjSR0TLj81YxGQ6LZTk2ZUQgybRBMeGeMQDocitnvSD5SblrY1yZr8k9abFb8bmg gAhPc5V5zOLxiZVcFHsLlxF9SQpoJ+RG1/ECiIUdLg5WUvgKJQrcwqG9k2eHQzP8MRYPm4 MIiW7DQ1W4OFrx0lTMbt7t5JTV6Gg5M9AyPUvsoYVKdwCRoXfjlbxoSD96u2v1M/DZD9Qq xv2lLd2kENVAJNMJ/kje/5OI0ZYJ6COhsYtTUrsTB9jcA1Y/3Yh5grch75ZZ0Q== 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=ihos3kVL43GcNnwvRQa8EAkart8aw0DgSI6lBkWbDJU=; b=tNP8S8uaOeL8Ez4ZLxuS/B4XuCm99BrOZr9dwAEZbjlXPrmbmY57RQ59QmcB9FIUCSSctq i2jivdb3ZSpw5PDw== 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>, Peter Zijlstra <peterz@infradead.org>, Mathias Nyman <mathias.nyman@linux.intel.com>, linux-usb@vger.kernel.org Subject: [PATCH printk v3 31/40] usb: early: xhci-dbc: use console_is_registered() Date: Mon, 7 Nov 2022 15:22:29 +0106 Message-Id: <20221107141638.3790965-32-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?1748847414668750556?= X-GMAIL-MSGID: =?utf-8?q?1748847414668750556?= |
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/usb/early/xhci-dbc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon 2022-11-07 15:22:29, 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/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c index bfb7e2b85299..797047154820 100644 --- a/drivers/usb/early/xhci-dbc.c +++ b/drivers/usb/early/xhci-dbc.c @@ -927,7 +927,7 @@ void __init early_xdbc_register_console(void) static void xdbc_unregister_console(void) { - if (early_xdbc_console.flags & CON_ENABLED) + if (console_is_registered(&early_xdbc_console)) unregister_console(&early_xdbc_console); }