From patchwork Wed Oct 19 14:55:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 5635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp378444wrs; Wed, 19 Oct 2022 08:09:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6z65xzNf4d6kUyuKtg53oVW1y5pfrdvQrPSG+x0YQxS8YBoxIOrzvoD1xoilTxKk1lftfP X-Received: by 2002:a17:907:a044:b0:78d:9180:125c with SMTP id gz4-20020a170907a04400b0078d9180125cmr7112273ejc.247.1666192148550; Wed, 19 Oct 2022 08:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192148; cv=none; d=google.com; s=arc-20160816; b=wrlBgyS9aYw+RL8RQ4YeeKM4idfl7sZRUEMjRwcU9n5V0wbBH99DPJnxSBg5lHqfKu w1ovNKKzvEVdkZXiCV+t/ZbtEIU2lpeJ4Xctb6S6so9DbCU4xvCMxqjmrqSsPmq0sACm p9UozMSqQAgvi8y8dQSR2UnA4caOa1KZQzjR5pppCYb4CkhPPvghSlpo/4MtqwhUMrqs 37O6Ev8tu3Ez+0gP2r+fdiTgUGS6d76wJgYn66hT+qYQM/eMqiDUdfuZ4Cg1ePacRadu HvYDpwyHoVeSCToQMeER87HNovsm+eY7YSIR4oK5NPWKd+dW4Izphf7RiqYs0uZd0adA +9ng== 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=KzgyVUdc3c3kCjuysiyU5ciOaxj14Ka8qNAluIGo2ws=; b=yMqaS6Gp8v4Am03FL+J8trY6dpOtbvYdCZrMjyj2gEItzG6NBZL8LxEdYlkX40nMYD YKtn5UUrV3Ar988J9JEFy5te496DwzuLQmX3eGbSUcSnqLD2D2iGj44CeBaOe/l+zuvT montBPRJm1r6oobHag1CYLXa1c+i6vyd2c3FZz3hK5kFrIt/Sb5Z7YiEC/1/O9xBgRW8 2d0kKNhK15jmvMASfTiom9cDpPMi1tZhz9tyjBql5pHFXzyP9qjmTCdfTtFqzkn0EPlR GQWgKF+dKjglr2Ew0r0BkhIbyuKtFFD/v77zRBDcrc6uf8VxOpbXq+ywIDrVQzG0Bu3T 93bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oMqTMwFg; 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 n11-20020a05640205cb00b0045d03c18e5bsi17808552edx.560.2022.10.19.08.08.42; Wed, 19 Oct 2022 08:09:08 -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=oMqTMwFg; 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 S229610AbiJSPGk (ORCPT + 99 others); Wed, 19 Oct 2022 11:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbiJSPFk (ORCPT ); Wed, 19 Oct 2022 11:05:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA2D32047; Wed, 19 Oct 2022 07:59:15 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666191370; 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=KzgyVUdc3c3kCjuysiyU5ciOaxj14Ka8qNAluIGo2ws=; b=oMqTMwFgA7TRBPKkkgg2SqcRq6lIX5GGgXm4dRv/bMgruBa0iJWddlwoaLUfKzhFqpC6WR gwr90qgT4eOy+NBCyDnpmsmy21dVcFJfucOAlyOaD0dBidVgI84sy3+hasNAbOJlFopeIX EoGBXAmUhpgj+FmhG/kz41N/6M8NIlNgrCEMfeZjFloXm7gwFQyF30r1x8A5O1Ae0MgVdJ w9n7t84CPDZqWN9vXSJzz+kCubBP+BWaDlt+OHM8hc8e8905TZMfm5ln6dAhILh8HZ273m myRuJkzDuM/0PtnahsjcVV7NerXl1J+nrLHS7FK5f2OsLl4h+1Sz88UbEye5LA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666191370; 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=KzgyVUdc3c3kCjuysiyU5ciOaxj14Ka8qNAluIGo2ws=; b=538n87jf9fQBuIO0i1kQOYmPKMxRqFehBEvcShiER+MFwipHan1NRjt/wMAfdBOIqq93S6 /K6fsXGFCl2rWVBg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH printk v2 15/38] tty: serial: serial_core: use console_is_enabled() Date: Wed, 19 Oct 2022 17:01:37 +0206 Message-Id: <20221019145600.1282823-16-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 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?1747129098525587561?= X-GMAIL-MSGID: =?utf-8?q?1747129098525587561?= Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). Signed-off-by: John Ogness Reviewed-by: Greg Kroah-Hartman Reviewed-by: Petr Mladek --- drivers/tty/serial/serial_core.c | 2 +- include/linux/serial_core.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 179ee199df34..ebf609e4e179 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2573,7 +2573,7 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, * successfully registered yet, try to re-register it. * It may be that the port was not available. */ - if (port->cons && !(port->cons->flags & CON_ENABLED)) + if (port->cons && !console_is_enabled(port->cons)) register_console(port->cons); /* diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d657f2a42a7b..ed5d1aeb91e1 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -745,7 +745,7 @@ static inline int setup_earlycon(char *buf) { return 0; } static inline bool uart_console_enabled(struct uart_port *port) { - return uart_console(port) && (port->cons->flags & CON_ENABLED); + return uart_console(port) && console_is_enabled(port->cons); } struct uart_port *uart_get_console(struct uart_port *ports, int nr,