From patchwork Mon Nov 14 16:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 19904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2238735wru; Mon, 14 Nov 2022 08:32:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6gioFzqmxeOccitCCmVhSsBUD4GcKKbO9V32Dhhcb3aBeKI9QdsXo3svjIDPBYNKNrBqcC X-Received: by 2002:a05:6402:12c2:b0:467:74b2:e17c with SMTP id k2-20020a05640212c200b0046774b2e17cmr10300456edx.344.1668443546988; Mon, 14 Nov 2022 08:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443546; cv=none; d=google.com; s=arc-20160816; b=kH2//cm2yBP5IaQII8HmbBNga+KjX0MlSC/FsW6GDOyUIo8LBx68o2u3QINJDFxkRw sbbL6DeDNzu4TCYvQc0jm8M9l0v+yCzl9N0LuYM/9Fp6U/Kc9lhSQrjxrcUGVKchnchW I3t8C61K97/AtvBDIJXvRMWc/KAgx27agxN/+WwwaNNVfsujLq9XXiRl1J8buypPLtrn i6UgmihXZ5Uq0GdKHh9E6htAPC4QjQ4u09nFfdY4c1rxN0gm89LK7qchs0j+SudlCuaG IKhWaLpUB0KGLz1M63kWi4e2Q4+D9tAy4NlfQm0VkRrWzmX+D43tFM+9SdrNTDkNqC5+ 9Ddw== 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=hIGZ90uFjuLuqOt79/kp9EKvIy8qC4ke5mgRicotv6vOGB56ULbaXGMYuWBEPIAbyw D+gQWnQHXX3zuL7l8CbU3PuQBiCTlRTPZ737GRKHNMPZN4JMd04i21xOQa4GhNFfrCAd TadXmMxG/JLhhCr6lkCZ90gXHDBPEXxMe9ZQNFJs4ZDMFurpMKyFMSoe2LzlTYXwsVJi X2qNPmZ3dfkaMS2ayvcSOHLRjRtKhlkRuJly315s0fCYc0NmEYw32dgRONUtpvus4bu6 k5+r59eh4neLxSqgNL25Bhth5GHPvb7/jxzavAoREFCARGj/G95CZqWty9PdQw/1xFMj lVMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gDRDGEIl; 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 go20-20020a1709070d9400b00783d5a873dcsi10327442ejc.341.2022.11.14.08.31.38; Mon, 14 Nov 2022 08:32:26 -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=gDRDGEIl; 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 S237805AbiKNQbP (ORCPT + 99 others); Mon, 14 Nov 2022 11:31:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237653AbiKNQa2 (ORCPT ); Mon, 14 Nov 2022 11:30:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 570182EF32; Mon, 14 Nov 2022 08:29:48 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668443386; 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=gDRDGEIlmAFx9jHad/WBpJk7dYEPGJDAe4Rk61bOKfOqT3mehUsQKb4keYsUMPSPsdPCH3 rh/IqkNd2kP12Z7ZZJ5Q6UpQi26MMcGDyn79l+kAgPljp3n+P/nE9gbcQHMels/aOZlf04 gvzaSIAO9Ov+RLj7wqaNb3eSDwxjPoyfs8flmUMma2qp4bWhG3+4S0HLB1HhV1AKJYSgCa szkb1zz0UHIRDO1rxOcXWYYeZyPGsEQDX3qRaTEnhRfn5nCLnkBEw1zRJUXCVuYN2De9ix pXy9j1e90b+yrfTItl3IJ3+fhxo/dA8V2eV6JZTU15Mr0n7Yj/pazIX44e1v5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668443386; 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=qEGMwJgLtL6+f1KskwLCVPpGRA/Rkj8qPXYJz8mOscQn36t/rcF9+WsdQUG6lPJ/3gDIvG HaEcIL6ZNzGiLpDg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Peter Zijlstra , Mathias Nyman , linux-usb@vger.kernel.org Subject: [PATCH printk v4 29/39] usb: early: xhci-dbc: use console_is_registered() Date: Mon, 14 Nov 2022 17:35:22 +0106 Message-Id: <20221114162932.141883-30-john.ogness@linutronix.de> In-Reply-To: <20221114162932.141883-1-john.ogness@linutronix.de> References: <20221114162932.141883-1-john.ogness@linutronix.de> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749489860836523170?= X-GMAIL-MSGID: =?utf-8?q?1749489860836523170?= 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 --- 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..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); }