Message ID | 20221019145600.1282823-19-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp378116wrs; Wed, 19 Oct 2022 08:08:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4FqvAqC3oACm5X0N+1YhOatWmXXCL9WKclXukffcjr11HkOLU1qIUbUiu7CLRafW3xcoAl X-Received: by 2002:a17:907:7f8f:b0:791:a840:56b4 with SMTP id qk15-20020a1709077f8f00b00791a84056b4mr2749604ejc.540.1666192109494; Wed, 19 Oct 2022 08:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192109; cv=none; d=google.com; s=arc-20160816; b=j9uLFaxdAUMUn+MJTzDFDzaj3vanZMBI9Fmye0uc5m077AdAsJkuzCPyGtoyIuILTJ t6wNzcW6pAirnn4FNQaRUGjNEvLy7Zmzq0bPiSjMBr9Db4y6vW2DX85j7o1FS5TF4dAG C1MKy5ybe5n8ru3wa5nZZQFX7T5sGMRO0jsZkY1KxiY2jE6jkAG24Mf3r59aTmhPLWi9 Khod3Tt0MEJrbvsgglrXExFv4iiN1Yn5kvlKIxfmQBtAh2zs4DqFm716OZm/NIVsbaru NhOcoPcNS3c1BBhsJUT9OaXpNlnn5MTK3XNRo0XZ98ttlTLO79/0qe9Nh7XMIsM2J8ub SA1w== 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=ROOYEsR0MhxheCxKtRPcb2mfw4k8DWEDO6Xw87lE788=; b=di+4avcc1cikiQixVgyECUYD3bnshI0pVNGDLdFp+LB/40fDO3UmMR8dIBu4/HFvI5 uFCz0TftEDlnVA18qPDNdvBWhwkOD9kHaX9QJyvlTsh6kLqEG2Uq/9zG90rvIOfh00L7 yWVrDM2TCEy9HutdhRF7VK7+nx3aVMvoSQKagHq/CuJFEW9PUWmR7e806IJ5I+xt9c2t UWm9T1KtlRF4RCWDkNQV27vRtWSZm7RxLNxq+MBZZH9zusD2Jo+GEodQIyemQhQ2haEI 9KWQmFzxGj5fyloO9DE9XX8ey/gfI+tjwW5z1QjB/8O8HgbyqvdVf/6FZovgMWrdqBLu npqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dj7K4xyS; 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 p7-20020a170906498700b0078d78fbb88dsi13246164eju.967.2022.10.19.08.08.00; Wed, 19 Oct 2022 08:08:29 -0700 (PDT) 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=dj7K4xyS; 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 S231700AbiJSPF7 (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 11:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbiJSPER (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 11:04:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6B413FDDA; Wed, 19 Oct 2022 07:59:04 -0700 (PDT) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666191372; 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=ROOYEsR0MhxheCxKtRPcb2mfw4k8DWEDO6Xw87lE788=; b=dj7K4xySpq7whNrvoUhtROBd4luyoKbpg6xTwFwhdIXZhbdt5NpgczLROroEXs3PgPR5nV 6HyH+7+1+Yrdno3e7XSvm+Rjun5P+yUigjsQD0kip44MepJ/Q022Y5oOoN2gaVaa8YRfl2 6KkfTfDFLG8D29GLh1KJj/8usWDl8staheqlg16yBFk55WoMgh3s8R3HdP3566EXWHdGH6 o7Jh2LwVPpRUpZwQ1KaXB7R3RaCUqh3kXswyT6GrZvNhezCCaXRsvfm77BMTZHoEQMPfxJ d6S8ayitsuWXl06xJ3vmxP14O6b/Blx/0zYuHK1UiScgBw0QdiyNqqvsWRpJLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666191372; 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=ROOYEsR0MhxheCxKtRPcb2mfw4k8DWEDO6Xw87lE788=; b=ryuSpo1BnIE5ZnNgWQJ91gufZbr2BMikTU+gIGl5WJJn0EfZEC0dlR7JSp8t5SfbRRzeKa qe9zWCaaaGZeIqAA== 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>, Mike Rapoport <rppt@kernel.org>, Mathias Nyman <mathias.nyman@linux.intel.com>, Andrew Morton <akpm@linux-foundation.org>, linux-usb@vger.kernel.org Subject: [PATCH printk v2 18/38] usb: early: xhci-dbc: use console_is_enabled() Date: Wed, 19 Oct 2022 17:01:40 +0206 Message-Id: <20221019145600.1282823-19-john.ogness@linutronix.de> In-Reply-To: <20221019145600.1282823-1-john.ogness@linutronix.de> References: <20221019145600.1282823-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?1747129057440152800?= X-GMAIL-MSGID: =?utf-8?q?1747129057440152800?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Oct. 19, 2022, 2:55 p.m. UTC
Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
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 Wed, Oct 19, 2022 at 05:01:40PM +0206, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Wed 2022-10-19 17:01:40, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > --- > drivers/usb/early/xhci-dbc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c > index bfb7e2b85299..b1a9c393160b 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_enabled(&early_xdbc_console)) > unregister_console(&early_xdbc_console); > } Again, we should rather check here if the console is in console_list. But it is old bug. It might be fixed later. The patch does not change the existing behavior. Feel free to use: 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..b1a9c393160b 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_enabled(&early_xdbc_console)) unregister_console(&early_xdbc_console); }