From patchwork Wed Jan 4 15:15:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38969 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5196864wrt; Wed, 4 Jan 2023 07:17:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsid/xQ8BM+yDc22eN6KIdUU+m6DjsdzcTEm0ppOC+91Cj/8DlB+OGeF8akqq8FBP0q2eo9 X-Received: by 2002:a17:906:f6d7:b0:7c1:5169:3ed6 with SMTP id jo23-20020a170906f6d700b007c151693ed6mr47162873ejb.48.1672845428950; Wed, 04 Jan 2023 07:17:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845428; cv=none; d=google.com; s=arc-20160816; b=Giy6558/64ZUXt50M9SZ/A2a9We7W3SWA1WqBHznxA0EOi9sdF1tyIQs65pNuiB2NP yaWwpAUl/nVXclHl0oIi2RmJYuYQTTfzJ5oBIIV1HfYaJ+sFfqx7q3hfSKH40SqDNvSP jF/cITEmzSVHNc5qDtdfPvHaAZKIsdDO3rRf4LPSePHHmDoBojEhdFm54uxu7mHB1NNV ZMng8rf8ep7l7PR63HNR3UDl9Ax25FQ/xS2PmB3QmFjIGdX4+e0jFnwkE5Ku7oE/zxz+ I/NuOcb+p80V2a/LouIVq7a5WTvZJj3tKrTYxvVm1jmDQmgw0fVoSZ10lVgiI/NaC/Yh PKbg== 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:from :dkim-signature; bh=LZetIoUkjgfPjYwyL7L5MwTEy/Z21dHUEhu4GFnm/0U=; b=bHs2rrosPC2nhLLm/7y7+/7LwmdHltjcTLsKQDKCKPtstn2FRGhlQDFyyfU5xONKX/ bYZI7HfSzw+XII5KltDl1eC6hDBU/2icfguH2pHmginojUN2/QuHGEvBQcERjF3ShPDs 2MHR/az/9g8NPiAsP7+jG+0I4sR5n7VepPdkxZ+ry1Mh6lFZLJW2XhGxVDo9Bc38hVNL Ku+yjbENeaXw99HwunNm2OCNnQbVfbfLe2gaw/09yNiDTvGxsg1k157HZ6sM/QBtgSO6 cOcdeE/fqWIN4Kb7LTZt5OLTWDhCo6rKEIbTkqbcuO6YAVdmiN3rJHwC6wCGGL8E7DHT 2rXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QzEVuGpx; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa14-20020a170906fd8e00b007c7148d0adcsi25628284ejb.979.2023.01.04.07.16.45; Wed, 04 Jan 2023 07:17:08 -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=@intel.com header.s=Intel header.b=QzEVuGpx; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239444AbjADPQH (ORCPT + 99 others); Wed, 4 Jan 2023 10:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235077AbjADPPw (ORCPT ); Wed, 4 Jan 2023 10:15:52 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B836CF0B; Wed, 4 Jan 2023 07:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845350; x=1704381350; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7kdvxV8bGJ6fYhD0Pgzv2x5Bo+g5OmbI4MqMtYfDL1o=; b=QzEVuGpx60cs/cQuR/H+ocgEi4YJG7U8jRVeNFx47Kkh9+e6FGZq9+iS 36ujmSujJX2mSoQ/TihvASciIxxTjJ6h8UPcQdbyC77kUdL8fFQjkhvCF VEXfnnnbGcBtdS4eHBQ0kVhMTXr9aFHPHsqw71qLpMkEHyvb7ZRbMPiwZ Jvw9TPKM6BQhfGfXzacxkHvF+EB8npSBTcpA0aGmJjeAsQlK+CElCx7nA gKB5ql6A70CmPmu8+SusiZspo+DBRVkyGMyhSu18stGuoLbP6Egpf/jUA sfH5W+bsUbQkZ4fZhY94UCPRSELE0pi4yZ3w/kukTAYcF8J5mzDQIe0dp w==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644304" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644304" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700676" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700676" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:43 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Samuel Iglesias Gonsalvez , Jens Taprogge , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Johan Hovold , linux-kernel@vger.kernel.org, industrypack-devel@lists.sourceforge.net, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 01/10] tty: Cleanup tty_port_set_initialized() bool parameter Date: Wed, 4 Jan 2023 17:15:22 +0200 Message-Id: <20230104151531.73994-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105568623991767?= X-GMAIL-MSGID: =?utf-8?q?1754105568623991767?= Make callers pass true/false consistently for bool val. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby Reviewed-by: Samuel Iglesias Gonsalvez --- drivers/char/pcmcia/synclink_cs.c | 4 ++-- drivers/ipack/devices/ipoctal.c | 4 ++-- drivers/s390/char/con3215.c | 4 ++-- drivers/tty/amiserial.c | 4 ++-- drivers/tty/moxa.c | 2 +- drivers/tty/mxser.c | 2 +- drivers/tty/n_gsm.c | 4 ++-- drivers/tty/serial/serial_core.c | 6 +++--- drivers/tty/synclink_gt.c | 4 ++-- drivers/tty/tty_port.c | 4 ++-- drivers/usb/serial/console.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index b2735be81ab2..baa46e8a094b 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -1309,7 +1309,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty) if (tty) clear_bit(TTY_IO_ERROR, &tty->flags); - tty_port_set_initialized(&info->port, 1); + tty_port_set_initialized(&info->port, true); return 0; } @@ -1359,7 +1359,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty) if (tty) set_bit(TTY_IO_ERROR, &tty->flags); - tty_port_set_initialized(&info->port, 0); + tty_port_set_initialized(&info->port, false); } static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty) diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index fc00274070b6..103fce0c49e6 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c @@ -647,7 +647,7 @@ static void ipoctal_hangup(struct tty_struct *tty) tty_port_hangup(&channel->tty_port); ipoctal_reset_channel(channel); - tty_port_set_initialized(&channel->tty_port, 0); + tty_port_set_initialized(&channel->tty_port, false); wake_up_interruptible(&channel->tty_port.open_wait); } @@ -659,7 +659,7 @@ static void ipoctal_shutdown(struct tty_struct *tty) return; ipoctal_reset_channel(channel); - tty_port_set_initialized(&channel->tty_port, 0); + tty_port_set_initialized(&channel->tty_port, false); } static void ipoctal_cleanup(struct tty_struct *tty) diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 72ba83c1bc79..0b05cd76b7d0 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -629,7 +629,7 @@ static int raw3215_startup(struct raw3215_info *raw) if (tty_port_initialized(&raw->port)) return 0; raw->line_pos = 0; - tty_port_set_initialized(&raw->port, 1); + tty_port_set_initialized(&raw->port, true); spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); raw3215_try_io(raw); spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); @@ -659,7 +659,7 @@ static void raw3215_shutdown(struct raw3215_info *raw) spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); remove_wait_queue(&raw->empty_wait, &wait); set_current_state(TASK_RUNNING); - tty_port_set_initialized(&raw->port, 1); + tty_port_set_initialized(&raw->port, true); } spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); } diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index f52266766df9..f8cdce1626cb 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -502,7 +502,7 @@ static int startup(struct tty_struct *tty, struct serial_state *info) */ change_speed(tty, info, NULL); - tty_port_set_initialized(port, 1); + tty_port_set_initialized(port, true); local_irq_restore(flags); return 0; @@ -556,7 +556,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) set_bit(TTY_IO_ERROR, &tty->flags); - tty_port_set_initialized(&info->tport, 0); + tty_port_set_initialized(&info->tport, false); local_irq_restore(flags); } diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 35b6fddf0341..bc474f3c3f8f 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1484,7 +1484,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) MoxaPortLineCtrl(ch, 1, 1); MoxaPortEnable(ch); MoxaSetFifo(ch, ch->type == PORT_16550A); - tty_port_set_initialized(&ch->port, 1); + tty_port_set_initialized(&ch->port, true); } mutex_unlock(&ch->port.mutex); mutex_unlock(&moxa_openlock); diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 2436e0b10f9a..2926a831727d 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1063,7 +1063,7 @@ static int mxser_set_serial_info(struct tty_struct *tty, } else { retval = mxser_activate(port, tty); if (retval == 0) - tty_port_set_initialized(port, 1); + tty_port_set_initialized(port, true); } mutex_unlock(&port->mutex); return retval; diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index daf12132deb1..631539c17d85 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2059,7 +2059,7 @@ static void gsm_dlci_close(struct gsm_dlci *dlci) tty_port_tty_hangup(&dlci->port, false); gsm_dlci_clear_queues(dlci->gsm, dlci); /* Ensure that gsmtty_open() can return. */ - tty_port_set_initialized(&dlci->port, 0); + tty_port_set_initialized(&dlci->port, false); wake_up_interruptible(&dlci->port.open_wait); } else dlci->gsm->dead = true; @@ -3880,7 +3880,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) dlci->modem_rx = 0; /* We could in theory open and close before we wait - eg if we get a DM straight back. This is ok as that will have caused a hangup */ - tty_port_set_initialized(port, 1); + tty_port_set_initialized(port, true); /* Start sending off SABM messages */ if (gsm->initiator) gsm_dlci_begin_open(dlci); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index b9fbbee598b8..e049c760b738 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -290,7 +290,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) set_bit(TTY_IO_ERROR, &tty->flags); if (tty_port_initialized(port)) { - tty_port_set_initialized(port, 0); + tty_port_set_initialized(port, false); /* * Turn off DTR and RTS early. @@ -2347,7 +2347,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) unsigned int mctrl; tty_port_set_suspended(port, 1); - tty_port_set_initialized(port, 0); + tty_port_set_initialized(port, false); spin_lock_irq(&uport->lock); ops->stop_tx(uport); @@ -2458,7 +2458,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) uart_rs485_config(uport); ops->start_tx(uport); spin_unlock_irq(&uport->lock); - tty_port_set_initialized(port, 1); + tty_port_set_initialized(port, true); } else { /* * Failed to resume - maybe hardware went away? diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 72b76cdde534..2b96bf0ecafb 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -2354,7 +2354,7 @@ static int startup(struct slgt_info *info) if (info->port.tty) clear_bit(TTY_IO_ERROR, &info->port.tty->flags); - tty_port_set_initialized(&info->port, 1); + tty_port_set_initialized(&info->port, true); return 0; } @@ -2401,7 +2401,7 @@ static void shutdown(struct slgt_info *info) if (info->port.tty) set_bit(TTY_IO_ERROR, &info->port.tty->flags); - tty_port_set_initialized(&info->port, 0); + tty_port_set_initialized(&info->port, false); } static void program_hw(struct slgt_info *info) diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index dce08a6d7b5e..0c00d5bd6c88 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -367,7 +367,7 @@ static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty) goto out; if (tty_port_initialized(port)) { - tty_port_set_initialized(port, 0); + tty_port_set_initialized(port, false); /* * Drop DTR/RTS if HUPCL is set. This causes any attached * modem to hang up the line. @@ -788,7 +788,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, return retval; } } - tty_port_set_initialized(port, 1); + tty_port_set_initialized(port, true); } mutex_unlock(&port->mutex); return tty_port_block_til_ready(port, tty, filp); diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index da19a5fa414f..c3ea3a46ed76 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -169,7 +169,7 @@ static int usb_console_setup(struct console *co, char *options) tty_save_termios(tty); tty_kref_put(tty); } - tty_port_set_initialized(&port->port, 1); + tty_port_set_initialized(&port->port, true); } /* Now that any required fake tty operations are completed restore * the tty port count */ From patchwork Wed Jan 4 15:15:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5196761wrt; Wed, 4 Jan 2023 07:16:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTg8Z85xFO+O1NZW4IlrJdV4sb33aFPCJ56pKfxYhGg5Uefpi4OOrz9FOJPwSIC9ZH2aoX X-Received: by 2002:a17:906:8a58:b0:7c1:75e9:986 with SMTP id gx24-20020a1709068a5800b007c175e90986mr38053467ejc.37.1672845418023; Wed, 04 Jan 2023 07:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845418; cv=none; d=google.com; s=arc-20160816; b=n8M0XWG+U6O4jpsQcJGKklbQMuf88KDFzAHZAKlzsQ0TGn10/hVAaWsOyLYJC+1Fq8 46D82InvhflC6MzAiZZlELMeavQKSK9ntxZ/OOTOJ2iUup0Vp+bPcGw+Gtl6w5tWSvJx 7PCT5xtAgDDsMiGG2yfpn1G0XqCiwFZUxFa2+ErinyJyAqNb/C7GeJbBKkrdKC4rI4t8 B0CYNNGGJOKkwY1dRqesbU+l3L1ePYH0NgyurA7xK3Z5W1otaj5tEDGWV+wwvcZzpW+n ozuR5Ff2Q6dj0+zS8XE2W5SUCj3ZNwzRwanu6W5iyRb9E6wVGbL3mWRfRQQpewAlF1cQ BEwg== 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:from :dkim-signature; bh=/F3qY6dRd0R7LE6ocXSjQCMZbJItLyxGARWYWsKco9w=; b=XfqBO57fFej1udDn+XnzWwmfG2k2I/AHWvo9L2pDDwUF0qJDwXim3u1bPuXbRP3PFP OjhappGHmEFvV1xvPYk/v31brgLxvjJsN1oSo8l0BKpxAWCKuE1fjWspRyu+pm0s8d3S nAP8LYN4eAWF5sGxAzxJupliIY8zFCfJnble6QdoC0+IzQqATnUEHZ9B2vo4kvT/KZ20 6gYYTb59Xykk8R2lYMwwPdwPuCr9MKaCsLGYfzUy7qliIN3u3/qyFHtRp4FZc5rwhZAs DODlbxR3DhNRohr6aF1rrg/C1Lso2/3Cei1CdMjjsXYbMkztuACl+0RtnVmtNYg5XCHo ShjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="PaUP/1mE"; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb29-20020a1709077e9d00b007c4fa177201si31892038ejc.180.2023.01.04.07.16.34; Wed, 04 Jan 2023 07:16:58 -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=@intel.com header.s=Intel header.b="PaUP/1mE"; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239490AbjADPQL (ORCPT + 99 others); Wed, 4 Jan 2023 10:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjADPPz (ORCPT ); Wed, 4 Jan 2023 10:15:55 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281912AEA; Wed, 4 Jan 2023 07:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845353; x=1704381353; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kDoL7FOyUUIFfG78pUESx3o8vuaKpREkODVrRIazBhM=; b=PaUP/1mEb6ORTqiF1UN4pf3zRPnuLKVvP0fzm+VSB5UwIy7EAWHLgucu i95KRVuxkQaX95fHdZSxERRhC1aVC9tG+GH47dkj11hck/b5N/cpUXMcr /CBMuDos3J2rMEQ2jC1e0CU6DpxyOnKr5lmWj0omeclaqI5RxDpY8bfSk zrs4iTy9tUB4ev+BXaJkpYHZdnKgaOUCv5Dzm8av7oW5Do4iRXURouq9a o23YHVKb65HXE8vwKqqfihD5wWAEQkoiIEM9NXoPZKwFWeH1NoqaKwEj/ 8lJmZLPbfjTb856dCNhaZ18yOX0QuZ/V7A49BzYHID+mckoT+tux8wUZO g==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644320" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644320" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:52 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700729" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700729" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:50 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 02/10] tty: Cleamup tty_port_set_suspended() bool parameter Date: Wed, 4 Jan 2023 17:15:23 +0200 Message-Id: <20230104151531.73994-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105557354095062?= X-GMAIL-MSGID: =?utf-8?q?1754105557354095062?= Make callers pass true/false consistently for bool val. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/tty/serial/serial_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index e049c760b738..f9564b1e3dfb 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -312,7 +312,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) * a DCD drop (hangup) at just the right time. Clear suspended bit so * we don't try to resume a port that has been shutdown. */ - tty_port_set_suspended(port, 0); + tty_port_set_suspended(port, false); /* * Do not free() the transmit buffer page under the port lock since @@ -1725,7 +1725,7 @@ static void uart_tty_port_shutdown(struct tty_port *port) * a DCD drop (hangup) at just the right time. Clear suspended bit so * we don't try to resume a port that has been shutdown. */ - tty_port_set_suspended(port, 0); + tty_port_set_suspended(port, false); /* * Free the transmit buffer. @@ -2346,7 +2346,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) int tries; unsigned int mctrl; - tty_port_set_suspended(port, 1); + tty_port_set_suspended(port, true); tty_port_set_initialized(port, false); spin_lock_irq(&uport->lock); @@ -2469,7 +2469,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) } } - tty_port_set_suspended(port, 0); + tty_port_set_suspended(port, false); } mutex_unlock(&port->mutex); From patchwork Wed Jan 4 15:15:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197115wrt; Wed, 4 Jan 2023 07:17:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXtpdaCP8usTv8YZVXyghezN4mWr2jtZyXdaUGYgxo/0gFdlissoqTT4uNdVs7hu7Lk7KasT X-Received: by 2002:a17:906:284d:b0:7ad:b865:d3b7 with SMTP id s13-20020a170906284d00b007adb865d3b7mr41665631ejc.21.1672845462293; Wed, 04 Jan 2023 07:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845462; cv=none; d=google.com; s=arc-20160816; b=xuY0oFj9+Vkjy+fE6nkjauWjKDaTa/0pRk2h5oPZS+IDb494sqmoBtrZXUHwHU8VvG MjWDgPm8C1CHajolozJ+gIL9GHrPVj5jPxe2xCaucSoFqNi+GLcX1imvDdFP6lopy4Jx i604i/7nNmjTmMbjA18dQowWvATevOoQOsh3NsIqKjl70qKRKzTB085noYi1uWa0s+wv cAYGk91VpYhVL8Auamq9+59ur6qQaWI1ndl9w5O6Ogo7KE2wHQsE7NpatU0digI8n+er RRqBzPdSTRgH/+xKzqGvYzasF33bcNf7JfK5SXkJfbAY+Q3qYg+9LCPYbxJLmzcHxM5w bXxQ== 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:from :dkim-signature; bh=BDbizEvyuGphwX509SqvR0nHS6mrcZjCowzEwjZWQYM=; b=Ri8jkl1wxf8EUHLMHBmCx9fm/0vVGMj3EtCtlT2RjwgG11ZcSMXSk6ce08aog9/epr OBVQwZGL9NEm5nyNBrz9+Lof3vy1pdW/VvB+VwxLbO9i2bYTkeuUMznQc56/zfiwgC8I XHjvlNGKDDjf9OWTZVZuv7diADzFXH6UozAdP2aKyiH7INCFCQ21hgmVwySDPv+9tERw IJShYITcN6Mwi/Ah86KCNvTQoE7osx9EQ72NyLtEJnkvOiqUPRh6rqnzJyng61JH/hw7 i5sGKTgrGHUHTB3C7YHGU7F5nKQ9WeXVuI76GhcE0hMq7wje84Xj/tYyVmZCjDz31gm0 ccjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UYWvuHPC; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc10-20020a056402204a00b0048ee8cf8bb8si2735458edb.53.2023.01.04.07.17.18; Wed, 04 Jan 2023 07:17:42 -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=@intel.com header.s=Intel header.b=UYWvuHPC; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239534AbjADPQW (ORCPT + 99 others); Wed, 4 Jan 2023 10:16:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239014AbjADPQE (ORCPT ); Wed, 4 Jan 2023 10:16:04 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A6160FE; Wed, 4 Jan 2023 07:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845356; x=1704381356; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=70BOEUeWaTy8AlA42qnHQSUWxrJnIuCIDjKwGENcT+M=; b=UYWvuHPC24HFfsg6hhVtSPUYJYW0WU70CijeAOOnsZ19v8tirGxIZuS7 o4blERkuWHLK4KodP6hPmaaNeg4s+n123YSV885y+TWf5Xa5Y7eG0YWRS NQf6fjhP/B9yB8hDmnX/ChF1kxYTSfosik8A8nT8sFB6DuY3QG+u8o4UM qTxDGyqG824OXciBhAvALTVTpIOyWCvBBme0jBNc9Kakg2OKRV/b1Oass G4szr+7egF8+Y3ZjXxVWZsiGgZgbxzT2xTXrpC0YED+Tg8LfjgJHee3qY 6dU4qHpdwAtuRhFoHCeUji52mQOrEoTBqM3iaO+CHqyAdScLhYDGFrsh7 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644332" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644332" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700738" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700738" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:54 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 03/10] tty: Cleanup tty_port_set_active() bool parameter Date: Wed, 4 Jan 2023 17:15:24 +0200 Message-Id: <20230104151531.73994-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105603222486079?= X-GMAIL-MSGID: =?utf-8?q?1754105603222486079?= Make callers pass true/false consistently for bool val. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/tty/amiserial.c | 2 +- drivers/tty/serial/serial_core.c | 4 ++-- drivers/tty/synclink_gt.c | 6 +++--- drivers/tty/tty_port.c | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index f8cdce1626cb..460d33a1e70b 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1329,7 +1329,7 @@ static void rs_hangup(struct tty_struct *tty) rs_flush_buffer(tty); shutdown(tty, info); info->tport.count = 0; - tty_port_set_active(&info->tport, 0); + tty_port_set_active(&info->tport, false); info->tport.tty = NULL; wake_up_interruptible(&info->tport.open_wait); } diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f9564b1e3dfb..c881fefa3d97 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1827,7 +1827,7 @@ static void uart_hangup(struct tty_struct *tty) spin_lock_irqsave(&port->lock, flags); port->count = 0; spin_unlock_irqrestore(&port->lock, flags); - tty_port_set_active(port, 0); + tty_port_set_active(port, false); tty_port_tty_set(port, NULL); if (uport && !uart_console(uport)) uart_change_pm(state, UART_PM_STATE_OFF); @@ -1945,7 +1945,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty) */ ret = uart_startup(tty, state, 0); if (ret > 0) - tty_port_set_active(port, 1); + tty_port_set_active(port, true); return ret; } diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 2b96bf0ecafb..81c94906f06e 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -694,7 +694,7 @@ static void hangup(struct tty_struct *tty) info->port.count = 0; info->port.tty = NULL; spin_unlock_irqrestore(&info->port.lock, flags); - tty_port_set_active(&info->port, 0); + tty_port_set_active(&info->port, false); mutex_unlock(&info->port.mutex); wake_up_interruptible(&info->port.open_wait); @@ -3169,7 +3169,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) { /* nonblock mode is set or port is not enabled */ - tty_port_set_active(port, 1); + tty_port_set_active(port, true); return 0; } @@ -3226,7 +3226,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open--; if (!retval) - tty_port_set_active(port, 1); + tty_port_set_active(port, true); DBGINFO(("%s block_til_ready ready, rc=%d\n", tty->driver->name, retval)); return retval; diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 0c00d5bd6c88..469de3c010b8 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -403,7 +403,7 @@ void tty_port_hangup(struct tty_port *port) set_bit(TTY_IO_ERROR, &tty->flags); port->tty = NULL; spin_unlock_irqrestore(&port->lock, flags); - tty_port_set_active(port, 0); + tty_port_set_active(port, false); tty_port_shutdown(port, tty); tty_kref_put(tty); wake_up_interruptible(&port->open_wait); @@ -518,14 +518,14 @@ int tty_port_block_til_ready(struct tty_port *port, * the port has just hung up or is in another error state. */ if (tty_io_error(tty)) { - tty_port_set_active(port, 1); + tty_port_set_active(port, true); return 0; } if (filp == NULL || (filp->f_flags & O_NONBLOCK)) { /* Indicate we are open */ if (C_BAUD(tty)) tty_port_raise_dtr_rts(port); - tty_port_set_active(port, 1); + tty_port_set_active(port, true); return 0; } @@ -588,7 +588,7 @@ int tty_port_block_til_ready(struct tty_port *port, port->blocked_open--; spin_unlock_irqrestore(&port->lock, flags); if (retval == 0) - tty_port_set_active(port, 1); + tty_port_set_active(port, true); return retval; } EXPORT_SYMBOL(tty_port_block_til_ready); @@ -695,7 +695,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty) wake_up_interruptible(&port->open_wait); } spin_unlock_irqrestore(&port->lock, flags); - tty_port_set_active(port, 0); + tty_port_set_active(port, false); } EXPORT_SYMBOL(tty_port_close_end); From patchwork Wed Jan 4 15:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5196775wrt; Wed, 4 Jan 2023 07:17:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtlaG33TWjH0ZZhjZqe7f/dDGegMPjIlzOjEXho7ay8+vWXS00FpI0vhAvJZC1U48vmwZIP X-Received: by 2002:a17:906:fb9a:b0:7c0:996b:be7f with SMTP id lr26-20020a170906fb9a00b007c0996bbe7fmr36993378ejb.29.1672845420537; Wed, 04 Jan 2023 07:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845420; cv=none; d=google.com; s=arc-20160816; b=PQOepiGcfE88kHRP/RaBPiiMM3xoaCUOSa+sey7w6b7VmtknqoGfM+yWhA0OmAel9U V4G9gt3fuPn6F0DhBnZnnlSYw61PLL7UOk27l24vO/eru9PiuXSqiSWRT2irTM4Ocfl+ Pn4O2zoILaVS7DijhXiPpkpvzfxTqJ8ia1PwzElMmd4h8F/qQtbbjRbhFA74t4/Y8yKl B2pFtu4gOdP1knC5iqfIbpYVQx3dOkEBHcJmU114s2u2gEsvkTg8g1ibkZiGNLt3dfxr 2wsC18El4dyOXKZXWXdnAfxidMSFKdlpRvHITk+bmWOXYPttvWwYqeJQNFz5/37zXO62 tjcQ== 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:from :dkim-signature; bh=JYKvUsVUnluDWY7DxNBkzDldkgnE2g2IbFcSGdVYRLk=; b=bfPRNWDeW/cwxZUZZ3t/3TOVRz6YqK/lqqFPRdLAAQ+FX/T79bowbfBJerDlMRtUzo +xCijthHEn+xt2n+zfFiXy+wf4DLQsjeZTShlbixAf+qlUydOpFyiIGCiiS9w2FnPW37 0GHqu3aIvIuR++F4USXIpRv6aAopADzTQIyFf5OozwIf5BEdiQVtg7oe+XnosWq9uEOC 6bu54RNSExRFalhRF2hp7o1lnhYlRS2jUnCpolFGg5aaDwxS+kM3QonIIaPFKfR1Qa3b FIuyEpumkpljJiQAb97r/tCr2qHcmoWSwBwNUdnWKgtF5KqshGpV7+eEIGhekrwUt6ds PFng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lJooWq9J; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy4-20020a170906fe0400b0078d770f363fsi29069614ejb.471.2023.01.04.07.16.36; Wed, 04 Jan 2023 07:17:00 -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=@intel.com header.s=Intel header.b=lJooWq9J; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239354AbjADPQQ (ORCPT + 99 others); Wed, 4 Jan 2023 10:16:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239119AbjADPQF (ORCPT ); Wed, 4 Jan 2023 10:16:05 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03BACE035; Wed, 4 Jan 2023 07:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845359; x=1704381359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WoYPJhgn0VzeKMK+DSthce4P36Cbw4uJWhaeJQ2MS28=; b=lJooWq9Jb5VoDjq6pTu81XBceMdGdCzNA9nOkW+je+3Rnm5xWL8aBYV0 x30BFqClq1WzG9yhYg/GZ7KuQ99DAL+r2Ml375HlS6a5PM1NxuxKgTEdV RqI5CVz4NoSQdggkEohTj4hJE2hnMV1hoTUQ4+vWZCuyOtozhd4qtDBlM lkJkZDAuzDOloDUdWRTErfneXbkPmC2kABJX2cOQ7X5T5ku0wevgYnNPA 9wj6nvTtCNT2g+KyTw+izapLLuUyBP/nSXfgZwQbDE9FrOR+tlr6HT/IE dAU1cJBUsy084DUUs5O6dShqds7/gGgQ0YFyf/7SUJeDZiRn5XRkWy6Yz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644338" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644338" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700754" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700754" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:56 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 04/10] tty: moxa: Make local var storing tty_port_initialized() bool Date: Wed, 4 Jan 2023 17:15:25 +0200 Message-Id: <20230104151531.73994-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105559245832850?= X-GMAIL-MSGID: =?utf-8?q?1754105559245832850?= Return type of tty_port_initialized() is bool, use matching type for the local variable. Also reorder the local vars to reverse-xmas-tree while at it. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/tty/moxa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index bc474f3c3f8f..2d9635e14ded 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1664,8 +1664,8 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle, u16 __iomem *ip) { struct tty_struct *tty = tty_port_tty_get(&p->port); + bool inited = tty_port_initialized(&p->port); void __iomem *ofsAddr; - unsigned int inited = tty_port_initialized(&p->port); u16 intr; if (tty) { From patchwork Wed Jan 4 15:15:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38970 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197015wrt; Wed, 4 Jan 2023 07:17:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXuHzRNPsEFkvhMFEe8qmQXloT3M1OyJ4vVmlB4F3lWikAp0sH04QMJctIRF4STp8baSrarV X-Received: by 2002:a17:907:7f24:b0:7c0:e0d9:d1b7 with SMTP id qf36-20020a1709077f2400b007c0e0d9d1b7mr52847901ejc.0.1672845447940; Wed, 04 Jan 2023 07:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845447; cv=none; d=google.com; s=arc-20160816; b=goonSffDBtYQo6shkJ96xCVnqCRpTpu9r9wX8p9Yke0pNJsHSZI/jvqXxT8eDEdvih 9v8fMEs0n2Gb69lcibcmuVaofOY02K6KsN17MPhei/L5aEQ/NPtPJ3DPnM5iwf4FqkZj duJXUXrQ6QdAT9LT0VGisOPH6Ybks7HUn4HMl5pQRjqhTrms3vwWdUucogqJtLxLJTBW anR3q6+gKEHp4d0Gg9G3FdCLYnfvRAUBbNnOsLYbKZTQSWMstUHB6dqpOFD13sgKlCRV u/CI9y5RdNDzav1okCVrC4L2AnQ1GLLs3VVHV3MtWcMDhy7AKXXP7I8k2R6E+AfBWUP+ PZNg== 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:from :dkim-signature; bh=KIV4r/Bf5A03FRd+QxXfLPRn+8Y7jo+KiGjaRiQy9bk=; b=ED93UInY2WN9A1lv4cg9VuQoo5V4/y0JhKP1cS9YLM3cT/IuDb1CzpvT6pADLsDgAP NrnL4GCAXNvVFKrnPVxUPeP/TFWVlNZtku5B/VEw5OBLlIGN5G4A+eMoVLFEEuP2zXsN nGckP876CQEWtpZvEpLmG68hiK8mYQzfFZ60kbzuqulbnSrI2gOZ+AZHFH3hHYKjbe23 ydFQMywyF9/OcaOBra8oVxcyTMHFpynNdQFHa7jrxddD7CHeuYef8Lb/pI35Q0Jw3JNJ eJ6TQcnzBOV0YBbCJgPN7Fxk05BQWWnUf5iXNyEsvvH7AALHfo+0zg4SB4I9fNxJIC0N 08eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NaZ0rDrz; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a1709063e5200b007c177f0064dsi24391197eji.972.2023.01.04.07.17.03; Wed, 04 Jan 2023 07:17:27 -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=@intel.com header.s=Intel header.b=NaZ0rDrz; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239545AbjADPQZ (ORCPT + 99 others); Wed, 4 Jan 2023 10:16:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239301AbjADPQF (ORCPT ); Wed, 4 Jan 2023 10:16:05 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 289BE167FA; Wed, 4 Jan 2023 07:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845362; x=1704381362; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4pMvCSqx3PAMTPEbaidZApfUuzWFE4oF2FcTwm2mVLI=; b=NaZ0rDrziHPBEqzby2YUcI0fkj0S/7ssKbEwoVbpW0qQpB6bvo5BueIW CQSvUbCxYQoRif4Fk/ko8j87s54EFp9yFlIrW8Vx7FVSTNMRUqwLkxbec IeSH9V6L8xURUP3EmTSphnbP12Ph+6SmE03FE/UDRLQUcSpx97mIoh9o1 TdRwiBxe1a+rzv+S/b7A43GTmPszj5oBW/yXxOuOW8GqF6mUfJWEg/jZ8 qe4beaOav/6MvwDmewqnqaUWl5g/khanYMUnOiRgpwMzAWDTchkDObNjC NoQeJo5II+7lF1pji9dSAo3rVVV7BH7fUCOXWXVFYoLznHucbaZNyEuwG A==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644364" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644364" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700784" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700784" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:15:59 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 05/10] serial: Convert uart_{,port_}startup() init_hw param to bool Date: Wed, 4 Jan 2023 17:15:26 +0200 Message-Id: <20230104151531.73994-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105588202198022?= X-GMAIL-MSGID: =?utf-8?q?1754105588202198022?= Convert init_hw parameter in uart_startup() and uart_port_startup() to bool as code treats them like bool. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/serial_core.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index c881fefa3d97..a0260a40bdb9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -181,8 +181,7 @@ static void uart_port_dtr_rts(struct uart_port *uport, int raise) * Startup the port. This will be called once per open. All calls * will be serialised by the per-port mutex. */ -static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, - int init_hw) +static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, bool init_hw) { struct uart_port *uport = uart_port_check(state); unsigned long flags; @@ -253,8 +252,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, return retval; } -static int uart_startup(struct tty_struct *tty, struct uart_state *state, - int init_hw) +static int uart_startup(struct tty_struct *tty, struct uart_state *state, bool init_hw) { struct tty_port *port = &state->port; int retval; @@ -997,7 +995,7 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, uart_change_speed(tty, state, NULL); } } else { - retval = uart_startup(tty, state, 1); + retval = uart_startup(tty, state, true); if (retval == 0) tty_port_set_initialized(port, true); if (retval > 0) @@ -1165,7 +1163,7 @@ static int uart_do_autoconfig(struct tty_struct *tty, struct uart_state *state) */ uport->ops->config_port(uport, flags); - ret = uart_startup(tty, state, 1); + ret = uart_startup(tty, state, true); if (ret == 0) tty_port_set_initialized(port, true); if (ret > 0) @@ -1943,7 +1941,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty) /* * Start up the serial port. */ - ret = uart_startup(tty, state, 0); + ret = uart_startup(tty, state, false); if (ret > 0) tty_port_set_active(port, true); From patchwork Wed Jan 4 15:15:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197416wrt; Wed, 4 Jan 2023 07:18:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXsK87y8w42lvrODJngJCrD3J9EmKe10k62USPpjOwM9BqvgUZO7dLClUwo8C34sPUfjvUZv X-Received: by 2002:a05:6402:cb4:b0:483:6d73:ad02 with SMTP id cn20-20020a0564020cb400b004836d73ad02mr39586779edb.35.1672845497001; Wed, 04 Jan 2023 07:18:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845496; cv=none; d=google.com; s=arc-20160816; b=aVFQn9IOZkPUDJNawm5GIm1UbjqtobUV8e+fzgQAIgG/OUd1pz6Vc4K1eKTHqyiToY +99cSmcIBfOjzqiGfUMpGfzsXfetLWu4Fm/sZoeRyxqPTygB8aPSK2i2JjIhfxD35v2m Wn0FHpf4E7LsIFIPIspjUewqWuq891BrQO33MDmwf/2Dwa/t3HjOKTfrxJ03Jk06zj+F gyc+hRf/oxgPE28QT9/pzzf+eZqCLFFx1pZdXGxoQfuhXBG3Uw2EGFiEdSlBHPxwh7VM pHEv44OqrUsjgm4nESLoa/uYnzlm0ESVvkfZvsKG5nxqK9nk7ZHk7ZHGI/f2ltiluDQe vxvA== 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:from :dkim-signature; bh=v1Q/Qn3EW0gimloZ9YSw4+CM2qN5MC0YpSINCAbj0BQ=; b=PUM1joa8mAnadkKFxiQ6rLVE5NNY1C6y42u/dl0NyJ4b9/LXoAUNyldNGr3hOTGHKD /y+JGOAYwd2z+MS3kwsxbwnZ5kaHshSnUKWd6mhtGjFAKptVoWKAp8F95itlz4bdEEBo Ljc4ulY9cAH8lW+wBFoNOfWTyXdJ9dug5mhNhkuJQ5NAJhq/G+1dfzeeS5oFIYYnLQA4 gX2C8ubG7CiAiCc4I9Yi3xAcq3i//36+lcotjHU5QaU10tQcE15XCqBYtLjWBidbGoL0 naSE+L4CEnswBN9CNzBiMTnrqCsXDi3dBUgA8ULtzVf5JA8XJNSmGQWyqy1kiVKvltTf Uy/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i+KQfkKd; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a056402430700b0047043b43e82si30314630edc.232.2023.01.04.07.17.51; Wed, 04 Jan 2023 07:18:16 -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=@intel.com header.s=Intel header.b=i+KQfkKd; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239594AbjADPRP (ORCPT + 99 others); Wed, 4 Jan 2023 10:17:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239464AbjADPQs (ORCPT ); Wed, 4 Jan 2023 10:16:48 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF70F1A3BA; Wed, 4 Jan 2023 07:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845399; x=1704381399; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CVWb6XG9UGQC3Di7ia+HzuhNkTupQPZIdsnMxoG1YN8=; b=i+KQfkKdmuIgTms5hqCNC8ybC8NwwQiu67FJCDAl23KBGr752s9VYhYH qF5B6y5Bg+4roMRu4425ijPKgar3VBPvHtpxORW9YCxfuGDi1zcsH/IX1 3w0KmE7Yzyt0Vb4DxrfHCCYOq29sFvfJam9B8e9s5qg4l3Nilzh7JJs+D P+JrV+KAD90s63Ww7eTsS8HTo2I8Y8DVwGYFzEIKdiujJqIRlApHwSFz5 zvUdGfXUbYxyn+MQiHOY1vsmpQ5bMwgJfIPIJN8h8qSjKBNKo+Gk155Sc sZRQQ9OKk3s1EEr02GoAp0Wr8zOLJTiFOg65WnXfcpCq86wMRLzgHUqDH Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644443" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644443" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700799" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700799" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:05 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Johan Hovold , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 06/10] tty: Convert ->carrier_raised() and callchains to bool Date: Wed, 4 Jan 2023 17:15:27 +0200 Message-Id: <20230104151531.73994-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105639717426667?= X-GMAIL-MSGID: =?utf-8?q?1754105639717426667?= Return boolean from ->carrier_raised() instead of 0 and 1. Make the return type change also to tty_port_carrier_raised() that makes the ->carrier_raised() call (+ cd variable in moxa into which its return value is stored). Also cleans up a few unnecessary constructs related to this change: return xx ? 1 : 0; -> return xx; if (xx) return 1; return 0; -> return xx; Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/char/pcmcia/synclink_cs.c | 8 +++----- drivers/mmc/core/sdio_uart.c | 7 +++---- drivers/tty/amiserial.c | 2 +- drivers/tty/moxa.c | 4 ++-- drivers/tty/mxser.c | 5 +++-- drivers/tty/n_gsm.c | 8 ++++---- drivers/tty/serial/serial_core.c | 9 ++++----- drivers/tty/synclink_gt.c | 7 ++++--- drivers/tty/tty_port.c | 4 ++-- drivers/usb/serial/ch341.c | 7 +++---- drivers/usb/serial/f81232.c | 6 ++---- drivers/usb/serial/pl2303.c | 7 ++----- drivers/usb/serial/spcp8x5.c | 7 ++----- drivers/usb/serial/usb-serial.c | 4 ++-- include/linux/tty_port.h | 6 +++--- include/linux/usb/serial.h | 2 +- net/bluetooth/rfcomm/tty.c | 2 +- 17 files changed, 42 insertions(+), 53 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index baa46e8a094b..4391138e1b8a 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -377,7 +377,7 @@ static void async_mode(MGSLPC_INFO *info); static void tx_timeout(struct timer_list *t); -static int carrier_raised(struct tty_port *port); +static bool carrier_raised(struct tty_port *port); static void dtr_rts(struct tty_port *port, int onoff); #if SYNCLINK_GENERIC_HDLC @@ -2430,7 +2430,7 @@ static void mgslpc_hangup(struct tty_struct *tty) tty_port_hangup(&info->port); } -static int carrier_raised(struct tty_port *port) +static bool carrier_raised(struct tty_port *port) { MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port); unsigned long flags; @@ -2439,9 +2439,7 @@ static int carrier_raised(struct tty_port *port) get_signals(info); spin_unlock_irqrestore(&info->lock, flags); - if (info->serial_signals & SerialSignal_DCD) - return 1; - return 0; + return info->serial_signals & SerialSignal_DCD; } static void dtr_rts(struct tty_port *port, int onoff) diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c index ae7ef2e038be..47f58258d8ff 100644 --- a/drivers/mmc/core/sdio_uart.c +++ b/drivers/mmc/core/sdio_uart.c @@ -526,7 +526,7 @@ static void sdio_uart_irq(struct sdio_func *func) port->in_sdio_uart_irq = NULL; } -static int uart_carrier_raised(struct tty_port *tport) +static bool uart_carrier_raised(struct tty_port *tport) { struct sdio_uart_port *port = container_of(tport, struct sdio_uart_port, port); @@ -535,9 +535,8 @@ static int uart_carrier_raised(struct tty_port *tport) return 1; ret = sdio_uart_get_mctrl(port); sdio_uart_release_func(port); - if (ret & TIOCM_CAR) - return 1; - return 0; + + return ret & TIOCM_CAR; } /** diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 460d33a1e70b..01c4fd3ce7c8 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1454,7 +1454,7 @@ static const struct tty_operations serial_ops = { .proc_show = rs_proc_show, }; -static int amiga_carrier_raised(struct tty_port *port) +static bool amiga_carrier_raised(struct tty_port *port) { return !(ciab.pra & SER_DCD); } diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 2d9635e14ded..6a1e78e33a2c 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -501,7 +501,7 @@ static int moxa_tiocmset(struct tty_struct *tty, static void moxa_poll(struct timer_list *); static void moxa_set_tty_param(struct tty_struct *, const struct ktermios *); static void moxa_shutdown(struct tty_port *); -static int moxa_carrier_raised(struct tty_port *); +static bool moxa_carrier_raised(struct tty_port *); static void moxa_dtr_rts(struct tty_port *, int); /* * moxa board interface functions: @@ -1432,7 +1432,7 @@ static void moxa_shutdown(struct tty_port *port) MoxaPortFlushData(ch, 2); } -static int moxa_carrier_raised(struct tty_port *port) +static bool moxa_carrier_raised(struct tty_port *port) { struct moxa_port *ch = container_of(port, struct moxa_port, port); int dcd; diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 2926a831727d..96c72e691cd7 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -458,10 +458,11 @@ static void __mxser_stop_tx(struct mxser_port *info) outb(info->IER, info->ioaddr + UART_IER); } -static int mxser_carrier_raised(struct tty_port *port) +static bool mxser_carrier_raised(struct tty_port *port) { struct mxser_port *mp = container_of(port, struct mxser_port, port); - return (inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD)?1:0; + + return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD; } static void mxser_dtr_rts(struct tty_port *port, int on) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 631539c17d85..81fc2ec3693f 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3770,16 +3770,16 @@ static int gsm_modem_update(struct gsm_dlci *dlci, u8 brk) return -EPROTONOSUPPORT; } -static int gsm_carrier_raised(struct tty_port *port) +static bool gsm_carrier_raised(struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); struct gsm_mux *gsm = dlci->gsm; /* Not yet open so no carrier info */ if (dlci->state != DLCI_OPEN) - return 0; + return false; if (debug & DBG_CD_ON) - return 1; + return true; /* * Basic mode with control channel in ADM mode may not respond @@ -3787,7 +3787,7 @@ static int gsm_carrier_raised(struct tty_port *port) */ if (gsm->encoding == GSM_BASIC_OPT && gsm->dlci[0]->mode == DLCI_MODE_ADM && !dlci->modem_rx) - return 1; + return true; return dlci->modem_rx & TIOCM_CD; } diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index a0260a40bdb9..f91b27e2058a 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1859,7 +1859,7 @@ static void uart_port_shutdown(struct tty_port *port) } } -static int uart_carrier_raised(struct tty_port *port) +static bool uart_carrier_raised(struct tty_port *port) { struct uart_state *state = container_of(port, struct uart_state, port); struct uart_port *uport; @@ -1873,15 +1873,14 @@ static int uart_carrier_raised(struct tty_port *port) * continue and not sleep */ if (WARN_ON(!uport)) - return 1; + return true; spin_lock_irq(&uport->lock); uart_enable_ms(uport); mctrl = uport->ops->get_mctrl(uport); spin_unlock_irq(&uport->lock); uart_port_deref(uport); - if (mctrl & TIOCM_CAR) - return 1; - return 0; + + return mctrl & TIOCM_CAR; } static void uart_dtr_rts(struct tty_port *port, int raise) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 81c94906f06e..4ba71ec764f7 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3126,7 +3126,7 @@ static int tiocmset(struct tty_struct *tty, return 0; } -static int carrier_raised(struct tty_port *port) +static bool carrier_raised(struct tty_port *port) { unsigned long flags; struct slgt_info *info = container_of(port, struct slgt_info, port); @@ -3134,7 +3134,8 @@ static int carrier_raised(struct tty_port *port) spin_lock_irqsave(&info->lock,flags); get_gtsignals(info); spin_unlock_irqrestore(&info->lock,flags); - return (info->signals & SerialSignal_DCD) ? 1 : 0; + + return info->signals & SerialSignal_DCD; } static void dtr_rts(struct tty_port *port, int on) @@ -3162,7 +3163,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, int retval; bool do_clocal = false; unsigned long flags; - int cd; + bool cd; struct tty_port *port = &info->port; DBGINFO(("%s block_til_ready\n", tty->driver->name)); diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 469de3c010b8..a573c500f95b 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -444,10 +444,10 @@ EXPORT_SYMBOL_GPL(tty_port_tty_wakeup); * to hide some internal details. This will eventually become entirely * internal to the tty port. */ -int tty_port_carrier_raised(struct tty_port *port) +bool tty_port_carrier_raised(struct tty_port *port) { if (port->ops->carrier_raised == NULL) - return 1; + return true; return port->ops->carrier_raised(port); } EXPORT_SYMBOL(tty_port_carrier_raised); diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 6e1b87e67304..792f01a4ed22 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -413,12 +413,11 @@ static void ch341_port_remove(struct usb_serial_port *port) kfree(priv); } -static int ch341_carrier_raised(struct usb_serial_port *port) +static bool ch341_carrier_raised(struct usb_serial_port *port) { struct ch341_private *priv = usb_get_serial_port_data(port); - if (priv->msr & CH341_BIT_DCD) - return 1; - return 0; + + return priv->msr & CH341_BIT_DCD; } static void ch341_dtr_rts(struct usb_serial_port *port, int on) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 891fb1fe69df..1a8c2925c26f 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -774,7 +774,7 @@ static bool f81232_tx_empty(struct usb_serial_port *port) return true; } -static int f81232_carrier_raised(struct usb_serial_port *port) +static bool f81232_carrier_raised(struct usb_serial_port *port) { u8 msr; struct f81232_private *priv = usb_get_serial_port_data(port); @@ -783,9 +783,7 @@ static int f81232_carrier_raised(struct usb_serial_port *port) msr = priv->modem_status; mutex_unlock(&priv->lock); - if (msr & UART_MSR_DCD) - return 1; - return 0; + return msr & UART_MSR_DCD; } static void f81232_get_serial(struct tty_struct *tty, struct serial_struct *ss) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 8949c1891164..4cb81746a149 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -1050,14 +1050,11 @@ static int pl2303_tiocmget(struct tty_struct *tty) return result; } -static int pl2303_carrier_raised(struct usb_serial_port *port) +static bool pl2303_carrier_raised(struct usb_serial_port *port) { struct pl2303_private *priv = usb_get_serial_port_data(port); - if (priv->line_status & UART_DCD) - return 1; - - return 0; + return priv->line_status & UART_DCD; } static void pl2303_set_break(struct usb_serial_port *port, bool enable) diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 09a972a838ee..8175db6c4554 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -247,16 +247,13 @@ static void spcp8x5_set_work_mode(struct usb_serial_port *port, u16 value, dev_err(&port->dev, "failed to set work mode: %d\n", ret); } -static int spcp8x5_carrier_raised(struct usb_serial_port *port) +static bool spcp8x5_carrier_raised(struct usb_serial_port *port) { u8 msr; int ret; ret = spcp8x5_get_msr(port, &msr); - if (ret || msr & MSR_STATUS_LINE_DCD) - return 1; - - return 0; + return ret || msr & MSR_STATUS_LINE_DCD; } static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 164521ee10c6..019720a63fac 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -754,7 +754,7 @@ static struct usb_serial_driver *search_serial_device( return NULL; } -static int serial_port_carrier_raised(struct tty_port *port) +static bool serial_port_carrier_raised(struct tty_port *port) { struct usb_serial_port *p = container_of(port, struct usb_serial_port, port); struct usb_serial_driver *drv = p->serial->type; @@ -762,7 +762,7 @@ static int serial_port_carrier_raised(struct tty_port *port) if (drv->carrier_raised) return drv->carrier_raised(p); /* No carrier control - don't block */ - return 1; + return true; } static void serial_port_dtr_rts(struct tty_port *port, int on) diff --git a/include/linux/tty_port.h b/include/linux/tty_port.h index fa3c3bdaa234..cf098459cb01 100644 --- a/include/linux/tty_port.h +++ b/include/linux/tty_port.h @@ -15,7 +15,7 @@ struct tty_struct; /** * struct tty_port_operations -- operations on tty_port - * @carrier_raised: return 1 if the carrier is raised on @port + * @carrier_raised: return true if the carrier is raised on @port * @dtr_rts: raise the DTR line if @raise is nonzero, otherwise lower DTR * @shutdown: called when the last close completes or a hangup finishes IFF the * port was initialized. Do not use to free resources. Turn off the device @@ -31,7 +31,7 @@ struct tty_struct; * the port itself. */ struct tty_port_operations { - int (*carrier_raised)(struct tty_port *port); + bool (*carrier_raised)(struct tty_port *port); void (*dtr_rts)(struct tty_port *port, int raise); void (*shutdown)(struct tty_port *port); int (*activate)(struct tty_port *port, struct tty_struct *tty); @@ -230,7 +230,7 @@ static inline void tty_port_set_kopened(struct tty_port *port, bool val) struct tty_struct *tty_port_tty_get(struct tty_port *port); void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); -int tty_port_carrier_raised(struct tty_port *port); +bool tty_port_carrier_raised(struct tty_port *port); void tty_port_raise_dtr_rts(struct tty_port *port); void tty_port_lower_dtr_rts(struct tty_port *port); void tty_port_hangup(struct tty_port *port); diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index f7bfedb740f5..dc7f90522b42 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -293,7 +293,7 @@ struct usb_serial_driver { /* Called by the tty layer for port level work. There may or may not be an attached tty at this point */ void (*dtr_rts)(struct usb_serial_port *port, int on); - int (*carrier_raised)(struct usb_serial_port *port); + bool (*carrier_raised)(struct usb_serial_port *port); /* Called by the usb serial hooks to allow the user to rework the termios state */ void (*init_termios)(struct tty_struct *tty); diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 8009e0e93216..5697df9d4394 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -119,7 +119,7 @@ static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) } /* we block the open until the dlc->state becomes BT_CONNECTED */ -static int rfcomm_dev_carrier_raised(struct tty_port *port) +static bool rfcomm_dev_carrier_raised(struct tty_port *port) { struct rfcomm_dev *dev = container_of(port, struct rfcomm_dev, port); From patchwork Wed Jan 4 15:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5198115wrt; Wed, 4 Jan 2023 07:19:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXuOG6KaIeuWMLbFPj8gJsxRWjQvPeUI9T1W4uDQKtHqKXymbiZ273uCeWwHrs5rqomvA8+v X-Received: by 2002:a05:6a00:1d88:b0:566:900d:a1cd with SMTP id z8-20020a056a001d8800b00566900da1cdmr49330042pfw.9.1672845577343; Wed, 04 Jan 2023 07:19:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845577; cv=none; d=google.com; s=arc-20160816; b=pg2cO22bRaoxCJqkJMGjnDKtl5FkkTwwg3/X7cqXWnBgZ3UUDE8feJGttQtgdr8xBd goemvoiNXQnokLskf7G0RJ1GcSKriefQyL9Spkei6iQuSntVNsSOsixPyAfiM9wWBBrp mqS9eMxhA8B3tHJ9+Re8kxzqYrHyFDIZARlz7adUH3qWhj5JJ99FtIsZKBeDkjVL5io9 DfDFry0QlvZhOwgVwXUsHkZvxISfFRIi8A52ORLMygJV5aabLKwGMInEdBiYBfgPA7kz GZSPCLdO/mAU2o1+1cpIVioXZsmFqtv0Bua0jlSZEFQ+8RoyMcVgev0f9MVA4fuHl95Q dQ8A== 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:from :dkim-signature; bh=sTHxrNxIBSdy2y4J+C9xzBp3IOwULAGOXbJnEKCiXNU=; b=ZET6VC+UShRAD8+ORE6fIiobs4pJqpNEqaX/iAMGPOHfWQSZYdNaSepgJ6qq5No2Tv kCEuTC6DiTeA1Xqs8o5oi8OYctpatnuYhIQ4YqlRpAQmXiXbM0wHm74uucWda2ZZbzLs 8Bmvs/sdncXqmaTUmHtr1SfLwGCsFk8WKRzabNtmgEulKUPluvOqr1A1LzquIonTd/FY O5MebHXRfsgtJpC/H971RtU4jroPVutXVAxkrmfNqm6u+DHSyFA8Z4mjEUP/PC0WtcLT Qeamf1GR2i0+M3eWQLs96x5YqIhIfVy/lPmRg7Q1kJSGsShFra3/N6FZRDrwVfpGtBG7 Lhmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ItmQMk+T; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020a056a00159500b00581da546a3csi6194978pfk.209.2023.01.04.07.19.24; Wed, 04 Jan 2023 07:19:37 -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=@intel.com header.s=Intel header.b=ItmQMk+T; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239626AbjADPR0 (ORCPT + 99 others); Wed, 4 Jan 2023 10:17:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239554AbjADPQt (ORCPT ); Wed, 4 Jan 2023 10:16:49 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631A6D136; Wed, 4 Jan 2023 07:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845407; x=1704381407; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XH/vy5Li7TYYPrj+Wf3N+vOETj2I9c42xrT1z/8hEk0=; b=ItmQMk+TO0mLj1y1xdo7F/c6j8y/AtAKV86Nq/8s+rKKtqq+K7k5ciOL XQYxgWmskxcP5a5ljStfevTOf+NNk9zLp/pde0KamDm+o1AwE6AYbWfn5 KtPXAw1cZKEC1fijddw7etmKbrSvveqh+nLUo5NGw0DB8QeVL7/jR6mZO oGxfU4dHrJCvmM3zRWZZntHcRiemlwbPbEilkzu9hrfjqEGCTP9p5VV81 HZH605ntEXnuQ7QEYjxEP0YqCUy+G+YJGJsigCLxWcTo9jFTOzh/Zqntj bJgjGd8gHSuqfylwK+R+ZLw9rlnrTXzvytVmPZw4JxljfWuj63gVQDhs1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644502" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644502" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:20 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700882" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700882" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:14 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Ulf Hansson , David Lin , Johan Hovold , Alex Elder , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Oliver Neukum , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 07/10] tty: Convert ->dtr_rts() to take bool argument Date: Wed, 4 Jan 2023 17:15:28 +0200 Message-Id: <20230104151531.73994-8-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105724113469994?= X-GMAIL-MSGID: =?utf-8?q?1754105724113469994?= Convert the raise/on parameter in ->dtr_rts() to bool through the callchain. The parameter is used like bool. In USB serial, there remains a few implicit bool -> larger type conversions because some devices use u8 in their control messages. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/char/pcmcia/synclink_cs.c | 4 ++-- drivers/mmc/core/sdio_uart.c | 4 ++-- drivers/staging/greybus/uart.c | 2 +- drivers/tty/amiserial.c | 2 +- drivers/tty/hvc/hvc_console.c | 4 ++-- drivers/tty/hvc/hvc_console.h | 2 +- drivers/tty/hvc/hvc_iucv.c | 4 ++-- drivers/tty/moxa.c | 16 ++++++++-------- drivers/tty/mxser.c | 2 +- drivers/tty/n_gsm.c | 2 +- drivers/tty/serial/serial_core.c | 8 ++++---- drivers/tty/synclink_gt.c | 2 +- drivers/tty/tty_port.c | 4 ++-- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/serial/ch341.c | 2 +- drivers/usb/serial/cp210x.c | 4 ++-- drivers/usb/serial/cypress_m8.c | 6 +++--- drivers/usb/serial/digi_acceleport.c | 6 +++--- drivers/usb/serial/f81232.c | 2 +- drivers/usb/serial/f81534.c | 2 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/ipw.c | 2 +- drivers/usb/serial/keyspan.c | 2 +- drivers/usb/serial/keyspan_pda.c | 2 +- drivers/usb/serial/mct_u232.c | 4 ++-- drivers/usb/serial/mxuport.c | 2 +- drivers/usb/serial/pl2303.c | 2 +- drivers/usb/serial/quatech2.c | 2 +- drivers/usb/serial/sierra.c | 2 +- drivers/usb/serial/spcp8x5.c | 2 +- drivers/usb/serial/ssu100.c | 2 +- drivers/usb/serial/upd78f0730.c | 6 +++--- drivers/usb/serial/usb-serial.c | 2 +- drivers/usb/serial/usb-wwan.h | 2 +- drivers/usb/serial/usb_wwan.c | 2 +- drivers/usb/serial/xr_serial.c | 6 +++--- include/linux/tty_port.h | 4 ++-- include/linux/usb/serial.h | 2 +- 38 files changed, 64 insertions(+), 64 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 4391138e1b8a..46a0b586d234 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info); static void tx_timeout(struct timer_list *t); static bool carrier_raised(struct tty_port *port); -static void dtr_rts(struct tty_port *port, int onoff); +static void dtr_rts(struct tty_port *port, bool onoff); #if SYNCLINK_GENERIC_HDLC #define dev_to_port(D) (dev_to_hdlc(D)->priv) @@ -2442,7 +2442,7 @@ static bool carrier_raised(struct tty_port *port) return info->serial_signals & SerialSignal_DCD; } -static void dtr_rts(struct tty_port *port, int onoff) +static void dtr_rts(struct tty_port *port, bool onoff) { MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port); unsigned long flags; diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c index 47f58258d8ff..c6b4b2b2a4b2 100644 --- a/drivers/mmc/core/sdio_uart.c +++ b/drivers/mmc/core/sdio_uart.c @@ -548,14 +548,14 @@ static bool uart_carrier_raised(struct tty_port *tport) * adjusted during an open, close and hangup. */ -static void uart_dtr_rts(struct tty_port *tport, int onoff) +static void uart_dtr_rts(struct tty_port *tport, bool onoff) { struct sdio_uart_port *port = container_of(tport, struct sdio_uart_port, port); int ret = sdio_uart_claim_func(port); if (ret) return; - if (onoff == 0) + if (!onoff) sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); else sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 90ff07f2cbf7..92d49740d5a4 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd, return -ENOIOCTLCMD; } -static void gb_tty_dtr_rts(struct tty_port *port, int on) +static void gb_tty_dtr_rts(struct tty_port *port, bool on) { struct gb_tty *gb_tty; u8 newctrl; diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 01c4fd3ce7c8..29d4c554f6b8 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1459,7 +1459,7 @@ static bool amiga_carrier_raised(struct tty_port *port) return !(ciab.pra & SER_DCD); } -static void amiga_dtr_rts(struct tty_port *port, int raise) +static void amiga_dtr_rts(struct tty_port *port, bool raise) { struct serial_state *info = container_of(port, struct serial_state, tport); diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index a683e21df19c..10c10cfdf92a 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -376,7 +376,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) /* We are ready... raise DTR/RTS */ if (C_BAUD(tty)) if (hp->ops->dtr_rts) - hp->ops->dtr_rts(hp, 1); + hp->ops->dtr_rts(hp, true); tty_port_set_initialized(&hp->port, true); } @@ -406,7 +406,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) if (C_HUPCL(tty)) if (hp->ops->dtr_rts) - hp->ops->dtr_rts(hp, 0); + hp->ops->dtr_rts(hp, false); if (hp->ops->notifier_del) hp->ops->notifier_del(hp, hp->data); diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 18d005814e4b..6d3428bf868f 100644 --- a/drivers/tty/hvc/hvc_console.h +++ b/drivers/tty/hvc/hvc_console.h @@ -66,7 +66,7 @@ struct hv_ops { int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear); /* Callbacks to handle tty ports */ - void (*dtr_rts)(struct hvc_struct *hp, int raise); + void (*dtr_rts)(struct hvc_struct *hp, bool raise); }; /* Register a vterm and a slot index for use as a console (console_init) */ diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c index 7d49a872de48..fe862a6882d6 100644 --- a/drivers/tty/hvc/hvc_iucv.c +++ b/drivers/tty/hvc/hvc_iucv.c @@ -658,13 +658,13 @@ static void hvc_iucv_notifier_hangup(struct hvc_struct *hp, int id) /** * hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS * @hp: Pointer the HVC device (struct hvc_struct) - * @raise: Non-zero to raise or zero to lower DTR/RTS lines + * @raise: True to raise or false to lower DTR/RTS lines * * This routine notifies the HVC back-end to raise or lower DTR/RTS * lines. Raising DTR/RTS is ignored. Lowering DTR/RTS indicates to * drop the IUCV connection (similar to hang up the modem). */ -static void hvc_iucv_dtr_rts(struct hvc_struct *hp, int raise) +static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise) { struct hvc_iucv_private *priv; struct iucv_path *path; diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 6a1e78e33a2c..d5726376420d 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -502,7 +502,7 @@ static void moxa_poll(struct timer_list *); static void moxa_set_tty_param(struct tty_struct *, const struct ktermios *); static void moxa_shutdown(struct tty_port *); static bool moxa_carrier_raised(struct tty_port *); -static void moxa_dtr_rts(struct tty_port *, int); +static void moxa_dtr_rts(struct tty_port *, bool); /* * moxa board interface functions: */ @@ -510,7 +510,7 @@ static void MoxaPortEnable(struct moxa_port *); static void MoxaPortDisable(struct moxa_port *); static int MoxaPortSetTermio(struct moxa_port *, struct ktermios *, speed_t); static int MoxaPortGetLineOut(struct moxa_port *, int *, int *); -static void MoxaPortLineCtrl(struct moxa_port *, int, int); +static void MoxaPortLineCtrl(struct moxa_port *, bool, bool); static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int); static int MoxaPortLineStatus(struct moxa_port *); static void MoxaPortFlushData(struct moxa_port *, int); @@ -1443,7 +1443,7 @@ static bool moxa_carrier_raised(struct tty_port *port) return dcd; } -static void moxa_dtr_rts(struct tty_port *port, int onoff) +static void moxa_dtr_rts(struct tty_port *port, bool onoff) { struct moxa_port *ch = container_of(port, struct moxa_port, port); MoxaPortLineCtrl(ch, onoff, onoff); @@ -1481,7 +1481,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) if (!tty_port_initialized(&ch->port)) { ch->statusflags = 0; moxa_set_tty_param(tty, &tty->termios); - MoxaPortLineCtrl(ch, 1, 1); + MoxaPortLineCtrl(ch, true, true); MoxaPortEnable(ch); MoxaSetFifo(ch, ch->type == PORT_16550A); tty_port_set_initialized(&ch->port, true); @@ -1892,10 +1892,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * * Function 14: Setting the DTR/RTS output state of this port. * Syntax: - * void MoxaPortLineCtrl(int port, int dtrState, int rtsState); + * void MoxaPortLineCtrl(int port, bool dtrState, bool rtsState); * int port : port number (0 - 127) - * int dtrState : DTR output state (0: off, 1: on) - * int rtsState : RTS output state (0: off, 1: on) + * int dtrState : DTR output state + * int rtsState : RTS output state * * * Function 15: Setting the flow control of this port. @@ -2114,7 +2114,7 @@ static int MoxaPortGetLineOut(struct moxa_port *port, int *dtrState, return 0; } -static void MoxaPortLineCtrl(struct moxa_port *port, int dtr, int rts) +static void MoxaPortLineCtrl(struct moxa_port *port, bool dtr, bool rts) { u8 mode = 0; diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 96c72e691cd7..d4fb11e39bb1 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -465,7 +465,7 @@ static bool mxser_carrier_raised(struct tty_port *port) return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD; } -static void mxser_dtr_rts(struct tty_port *port, int on) +static void mxser_dtr_rts(struct tty_port *port, bool on) { struct mxser_port *mp = container_of(port, struct mxser_port, port); unsigned long flags; diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 81fc2ec3693f..8dd0d6441c42 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3792,7 +3792,7 @@ static bool gsm_carrier_raised(struct tty_port *port) return dlci->modem_rx & TIOCM_CD; } -static void gsm_dtr_rts(struct tty_port *port, int onoff) +static void gsm_dtr_rts(struct tty_port *port, bool onoff) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); unsigned int modem_tx = dlci->modem_tx; diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f91b27e2058a..07b4af10a7e9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -169,7 +169,7 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear) #define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0) #define uart_clear_mctrl(port, clear) uart_update_mctrl(port, 0, clear) -static void uart_port_dtr_rts(struct uart_port *uport, int raise) +static void uart_port_dtr_rts(struct uart_port *uport, bool raise) { if (raise) uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); @@ -238,7 +238,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, b * port is open and ready to respond. */ if (init_hw && C_BAUD(tty)) - uart_port_dtr_rts(uport, 1); + uart_port_dtr_rts(uport, true); } /* @@ -300,7 +300,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) } if (!tty || C_HUPCL(tty)) - uart_port_dtr_rts(uport, 0); + uart_port_dtr_rts(uport, false); uart_port_shutdown(port); } @@ -1883,7 +1883,7 @@ static bool uart_carrier_raised(struct tty_port *port) return mctrl & TIOCM_CAR; } -static void uart_dtr_rts(struct tty_port *port, int raise) +static void uart_dtr_rts(struct tty_port *port, bool raise) { struct uart_state *state = container_of(port, struct uart_state, port); struct uart_port *uport; diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 4ba71ec764f7..2b786265ce7b 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3138,7 +3138,7 @@ static bool carrier_raised(struct tty_port *port) return info->signals & SerialSignal_DCD; } -static void dtr_rts(struct tty_port *port, int on) +static void dtr_rts(struct tty_port *port, bool on) { unsigned long flags; struct slgt_info *info = container_of(port, struct slgt_info, port); diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index a573c500f95b..a788a6bf487d 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -463,7 +463,7 @@ EXPORT_SYMBOL(tty_port_carrier_raised); void tty_port_raise_dtr_rts(struct tty_port *port) { if (port->ops->dtr_rts) - port->ops->dtr_rts(port, 1); + port->ops->dtr_rts(port, true); } EXPORT_SYMBOL(tty_port_raise_dtr_rts); @@ -478,7 +478,7 @@ EXPORT_SYMBOL(tty_port_raise_dtr_rts); void tty_port_lower_dtr_rts(struct tty_port *port) { if (port->ops->dtr_rts) - port->ops->dtr_rts(port, 0); + port->ops->dtr_rts(port, false); } EXPORT_SYMBOL(tty_port_lower_dtr_rts); diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 36bf051b345b..d4f9220b8162 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -651,7 +651,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) return tty_port_open(&acm->port, tty, filp); } -static void acm_port_dtr_rts(struct tty_port *port, int raise) +static void acm_port_dtr_rts(struct tty_port *port, bool raise) { struct acm *acm = container_of(port, struct acm, port); int val; diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 792f01a4ed22..98ec4fe46914 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -420,7 +420,7 @@ static bool ch341_carrier_raised(struct usb_serial_port *port) return priv->msr & CH341_BIT_DCD; } -static void ch341_dtr_rts(struct usb_serial_port *port, int on) +static void ch341_dtr_rts(struct usb_serial_port *port, bool on) { struct ch341_private *priv = usb_get_serial_port_data(port); unsigned long flags; diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 67372acc2352..fe2cdc477fb9 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -45,7 +45,7 @@ static void cp210x_disconnect(struct usb_serial *); static void cp210x_release(struct usb_serial *); static int cp210x_port_probe(struct usb_serial_port *); static void cp210x_port_remove(struct usb_serial_port *); -static void cp210x_dtr_rts(struct usb_serial_port *port, int on); +static void cp210x_dtr_rts(struct usb_serial_port *port, bool on); static void cp210x_process_read_urb(struct urb *urb); static void cp210x_enable_event_mode(struct usb_serial_port *port); static void cp210x_disable_event_mode(struct usb_serial_port *port); @@ -1402,7 +1402,7 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, return ret; } -static void cp210x_dtr_rts(struct usb_serial_port *port, int on) +static void cp210x_dtr_rts(struct usb_serial_port *port, bool on) { if (on) cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0); diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 1e0c028c5ec9..7c6060c17ee0 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -118,7 +118,7 @@ static int cypress_ca42v2_port_probe(struct usb_serial_port *port); static void cypress_port_remove(struct usb_serial_port *port); static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port); static void cypress_close(struct usb_serial_port *port); -static void cypress_dtr_rts(struct usb_serial_port *port, int on); +static void cypress_dtr_rts(struct usb_serial_port *port, bool on); static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count); static void cypress_send(struct usb_serial_port *port); @@ -621,12 +621,12 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port) return result; } /* cypress_open */ -static void cypress_dtr_rts(struct usb_serial_port *port, int on) +static void cypress_dtr_rts(struct usb_serial_port *port, bool on) { struct cypress_private *priv = usb_get_serial_port_data(port); /* drop dtr and rts */ spin_lock_irq(&priv->lock); - if (on == 0) + if (!on) priv->line_control = 0; else priv->line_control = CONTROL_DTR | CONTROL_RTS; diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 45d688e9b93f..890e446273d7 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -228,7 +228,7 @@ static unsigned int digi_write_room(struct tty_struct *tty); static unsigned int digi_chars_in_buffer(struct tty_struct *tty); static int digi_open(struct tty_struct *tty, struct usb_serial_port *port); static void digi_close(struct usb_serial_port *port); -static void digi_dtr_rts(struct usb_serial_port *port, int on); +static void digi_dtr_rts(struct usb_serial_port *port, bool on); static int digi_startup_device(struct usb_serial *serial); static int digi_startup(struct usb_serial *serial); static void digi_disconnect(struct usb_serial *serial); @@ -1060,10 +1060,10 @@ static unsigned int digi_chars_in_buffer(struct tty_struct *tty) return chars; } -static void digi_dtr_rts(struct usb_serial_port *port, int on) +static void digi_dtr_rts(struct usb_serial_port *port, bool on) { /* Adjust DTR and RTS */ - digi_set_modem_signals(port, on * (TIOCM_DTR | TIOCM_RTS), 1); + digi_set_modem_signals(port, on ? (TIOCM_DTR | TIOCM_RTS) : 0, 1); } static int digi_open(struct tty_struct *tty, struct usb_serial_port *port) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 1a8c2925c26f..1656be847460 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -752,7 +752,7 @@ static void f81232_close(struct usb_serial_port *port) flush_work(&port_priv->lsr_work); } -static void f81232_dtr_rts(struct usb_serial_port *port, int on) +static void f81232_dtr_rts(struct usb_serial_port *port, bool on) { if (on) f81232_set_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0); diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index 4083ae961be4..8b44b08752d6 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f81534.c @@ -1456,7 +1456,7 @@ static int f81534_tiocmset(struct tty_struct *tty, unsigned int set, return f81534_update_mctrl(port, set, clear); } -static void f81534_dtr_rts(struct usb_serial_port *port, int on) +static void f81534_dtr_rts(struct usb_serial_port *port, bool on) { if (on) f81534_update_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0); diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 05e28a5ce42b..09bdf623e94e 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2366,7 +2366,7 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) return usb_serial_generic_open(tty, port); } -static void ftdi_dtr_rts(struct usb_serial_port *port, int on) +static void ftdi_dtr_rts(struct usb_serial_port *port, bool on) { struct ftdi_private *priv = usb_get_serial_port_data(port); diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index d04c7cc5c1c2..b1b7a033cc75 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -215,7 +215,7 @@ static void ipw_release(struct usb_serial *serial) kfree(data); } -static void ipw_dtr_rts(struct usb_serial_port *port, int on) +static void ipw_dtr_rts(struct usb_serial_port *port, bool on) { struct usb_device *udev = port->serial->dev; struct device *dev = &port->dev; diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 2966e0c4941e..7e375367354b 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -1564,7 +1564,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) return 0; } -static void keyspan_dtr_rts(struct usb_serial_port *port, int on) +static void keyspan_dtr_rts(struct usb_serial_port *port, bool on) { struct keyspan_port_private *p_priv = usb_get_serial_port_data(port); diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 6fd15cd9e1eb..cb16c4bc8555 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -551,7 +551,7 @@ static int keyspan_pda_write(struct tty_struct *tty, struct usb_serial_port *por return count; } -static void keyspan_pda_dtr_rts(struct usb_serial_port *port, int on) +static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool on) { struct usb_serial *serial = port->serial; diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index d3852feb81a4..eb3520490dd2 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -42,7 +42,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port); static void mct_u232_port_remove(struct usb_serial_port *remove); static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port); static void mct_u232_close(struct usb_serial_port *port); -static void mct_u232_dtr_rts(struct usb_serial_port *port, int on); +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on); static void mct_u232_read_int_callback(struct urb *urb); static void mct_u232_set_termios(struct tty_struct *tty, struct usb_serial_port *port, @@ -477,7 +477,7 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port) return retval; } /* mct_u232_open */ -static void mct_u232_dtr_rts(struct usb_serial_port *port, int on) +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on) { unsigned int control_state; struct mct_u232_private *priv = usb_get_serial_port_data(port); diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c index faa0eedfe245..ac7594635719 100644 --- a/drivers/usb/serial/mxuport.c +++ b/drivers/usb/serial/mxuport.c @@ -674,7 +674,7 @@ static int mxuport_set_rts(struct usb_serial_port *port, u8 state) return err; } -static void mxuport_dtr_rts(struct usb_serial_port *port, int on) +static void mxuport_dtr_rts(struct usb_serial_port *port, bool on) { struct mxuport_port *mxport = usb_get_serial_port_data(port); u8 mcr_state; diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 4cb81746a149..cb20911f35bb 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -931,7 +931,7 @@ static void pl2303_set_termios(struct tty_struct *tty, kfree(buf); } -static void pl2303_dtr_rts(struct usb_serial_port *port, int on) +static void pl2303_dtr_rts(struct usb_serial_port *port, bool on) { struct pl2303_private *priv = usb_get_serial_port_data(port); unsigned long flags; diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 6fca40ace83a..6fd329ffec7e 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -770,7 +770,7 @@ static void qt2_break_ctl(struct tty_struct *tty, int break_state) -static void qt2_dtr_rts(struct usb_serial_port *port, int on) +static void qt2_dtr_rts(struct usb_serial_port *port, bool on) { struct usb_device *dev = port->serial->dev; struct qt2_port_private *port_priv = usb_get_serial_port_data(port); diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 353b2549eaa8..f2c3a7af1a4a 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -813,7 +813,7 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) } -static void sierra_dtr_rts(struct usb_serial_port *port, int on) +static void sierra_dtr_rts(struct usb_serial_port *port, bool on) { struct sierra_port_private *portdata; diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 8175db6c4554..02402ea3bd1b 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -256,7 +256,7 @@ static bool spcp8x5_carrier_raised(struct usb_serial_port *port) return ret || msr & MSR_STATUS_LINE_DCD; } -static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on) +static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool on) { struct spcp8x5_private *priv = usb_get_serial_port_data(port); unsigned long flags; diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 1e1888b66305..4cff39895804 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -385,7 +385,7 @@ static int ssu100_tiocmset(struct tty_struct *tty, return update_mctrl(dev, set, clear); } -static void ssu100_dtr_rts(struct usb_serial_port *port, int on) +static void ssu100_dtr_rts(struct usb_serial_port *port, bool on) { struct usb_device *dev = port->serial->dev; diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index c47439bd90fa..206749fe3263 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c @@ -262,7 +262,7 @@ static void upd78f0730_break_ctl(struct tty_struct *tty, int break_state) mutex_unlock(&private->lock); } -static void upd78f0730_dtr_rts(struct usb_serial_port *port, int on) +static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool on) { struct tty_struct *tty = port->port.tty; unsigned int set = 0; @@ -307,9 +307,9 @@ static void upd78f0730_set_termios(struct tty_struct *tty, return; if (C_BAUD(tty) == B0) - upd78f0730_dtr_rts(port, 0); + upd78f0730_dtr_rts(port, false); else if (old_termios && (old_termios->c_cflag & CBAUD) == B0) - upd78f0730_dtr_rts(port, 1); + upd78f0730_dtr_rts(port, true); baud_rate = upd78f0730_get_baud_rate(tty); request.opcode = UPD78F0730_CMD_LINE_CONTROL; diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 019720a63fac..f8404073558b 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -765,7 +765,7 @@ static bool serial_port_carrier_raised(struct tty_port *port) return true; } -static void serial_port_dtr_rts(struct tty_port *port, int on) +static void serial_port_dtr_rts(struct tty_port *port, bool on) { struct usb_serial_port *p = container_of(port, struct usb_serial_port, port); struct usb_serial_driver *drv = p->serial->type; diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h index 519101945769..b2a07dd44225 100644 --- a/drivers/usb/serial/usb-wwan.h +++ b/drivers/usb/serial/usb-wwan.h @@ -6,7 +6,7 @@ #ifndef __LINUX_USB_USB_WWAN #define __LINUX_USB_USB_WWAN -extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on); +extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on); extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port); extern void usb_wwan_close(struct usb_serial_port *port); extern int usb_wwan_port_probe(struct usb_serial_port *port); diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 0017f6e969e1..168b11cc02b6 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -69,7 +69,7 @@ static int usb_wwan_send_setup(struct usb_serial_port *port) return res; } -void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) +void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on) { struct usb_wwan_port_private *portdata; struct usb_wwan_intf_private *intfdata; diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index fdb0aae546c3..9aaed09d45e4 100644 --- a/drivers/usb/serial/xr_serial.c +++ b/drivers/usb/serial/xr_serial.c @@ -495,7 +495,7 @@ static int xr_tiocmset(struct tty_struct *tty, return xr_tiocmset_port(port, set, clear); } -static void xr_dtr_rts(struct usb_serial_port *port, int on) +static void xr_dtr_rts(struct usb_serial_port *port, bool on) { if (on) xr_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0); @@ -669,9 +669,9 @@ static void xr_set_flow_mode(struct tty_struct *tty, xr_uart_enable(port); if (C_BAUD(tty) == B0) - xr_dtr_rts(port, 0); + xr_dtr_rts(port, false); else if (old_termios && (old_termios->c_cflag & CBAUD) == B0) - xr_dtr_rts(port, 1); + xr_dtr_rts(port, true); } static void xr21v141x_set_line_settings(struct tty_struct *tty, diff --git a/include/linux/tty_port.h b/include/linux/tty_port.h index cf098459cb01..c44e489de0ff 100644 --- a/include/linux/tty_port.h +++ b/include/linux/tty_port.h @@ -16,7 +16,7 @@ struct tty_struct; /** * struct tty_port_operations -- operations on tty_port * @carrier_raised: return true if the carrier is raised on @port - * @dtr_rts: raise the DTR line if @raise is nonzero, otherwise lower DTR + * @dtr_rts: raise the DTR line if @raise is true, otherwise lower DTR * @shutdown: called when the last close completes or a hangup finishes IFF the * port was initialized. Do not use to free resources. Turn off the device * only. Called under the port mutex to serialize against @activate and @@ -32,7 +32,7 @@ struct tty_struct; */ struct tty_port_operations { bool (*carrier_raised)(struct tty_port *port); - void (*dtr_rts)(struct tty_port *port, int raise); + void (*dtr_rts)(struct tty_port *port, bool raise); void (*shutdown)(struct tty_port *port); int (*activate)(struct tty_port *port, struct tty_struct *tty); void (*destruct)(struct tty_port *port); diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index dc7f90522b42..c597357853d9 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -292,7 +292,7 @@ struct usb_serial_driver { struct serial_icounter_struct *icount); /* Called by the tty layer for port level work. There may or may not be an attached tty at this point */ - void (*dtr_rts)(struct usb_serial_port *port, int on); + void (*dtr_rts)(struct usb_serial_port *port, bool on); bool (*carrier_raised)(struct usb_serial_port *port); /* Called by the usb serial hooks to allow the user to rework the termios state */ From patchwork Wed Jan 4 15:15:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38975 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197446wrt; Wed, 4 Jan 2023 07:18:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtE9nAx80RmVFMKnhA2DPxTbVQAs9+autvDgWGr6Hd9sXD7rnWB3ipySetqWLUo7J58xTVn X-Received: by 2002:a05:6a20:d496:b0:a7:a3cf:ddce with SMTP id im22-20020a056a20d49600b000a7a3cfddcemr54538975pzb.21.1672845501097; Wed, 04 Jan 2023 07:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845501; cv=none; d=google.com; s=arc-20160816; b=Q1K0kNEqvQeU8CZGWhTYDbH5eNZORhbknZlRtXkcmPXBrri2ndUwMfFD+FVXY/KecR PXTlZgncCPKIhyHq2i8zRepG+/SSvAWj1eNvW2LMdsBvPgJPTs84MbI8OlhS+ve6RsNz KK8Yupg7lHLLa6QXlQAEkDPw8j+dLpkVXlgv8I8ynBKLAoc6+XYn5qJhCZxm1eaRjFlO r+dauvxNrvVD8oxWz9SL8V7123+Lzk7tQS9M4xXBuSAnpGNcQdzcv3q8G3ebUskI81zt +Dnw6TKWfNdBboRqOvL7SZFT23MdFjV6bm8BpaLYWFfY8eEJmMwdbGYWPggMMm3FnuF5 jWHA== 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:from :dkim-signature; bh=EX+hTyeiHHH8+lmylQuLxvRRTAu2S7owEVDG6EaWPPY=; b=wqwnuW4VdJF5jg2hepGLB5g+x4/MlhvTn0kpIQ9k4du0ck3xezpXZIrRlqkciP5DQT a/HYzvixjG4ndlu/hyvXUjRQbWFi9CVoXmuGgkUWFL8H0l0zPm2nlHaR+46inL9lqfVH YNHIoR/fAmw8eXCpyx1mMTXHQLOJ1KQOGL9Or/AOfknMSc9iTIGT1W39jYOupwWxcsqd VVFrUtYDowG/7we12fLjbbtTrE01MtfjQh+RLxa+KuqEf0Yf7vPDZWQkKILiLYOjiTy3 9XxMVMjO1bIj+qf8zBPDRA3vdYCO8ihWX1XH+UtKrTgQnYlU/YeT5dG2ybR5katmAm4S SMsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AImzo9x5; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170903120700b001747ed48ee8si37660485plh.150.2023.01.04.07.18.07; Wed, 04 Jan 2023 07:18:21 -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=@intel.com header.s=Intel header.b=AImzo9x5; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239666AbjADPRK (ORCPT + 99 others); Wed, 4 Jan 2023 10:17:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239594AbjADPQt (ORCPT ); Wed, 4 Jan 2023 10:16:49 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27667F0B; Wed, 4 Jan 2023 07:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845409; x=1704381409; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZPHVabX/cSkxQW1KrADJmTufBu4DKd9OGYScWAnxr2o=; b=AImzo9x5VtgeIeFHJgqsrR5X+yaxq+FwKAbfzlu9jkC184rbKzTPj+e1 wvsvYvGUtv5aFsJoKwc8JBICq0WzR+NGInJhEIlA2ZiD1nx/KSo08gnOx ItCgm6y+w5afHDCIM56QlMYGvhov0Iprs37fRdshICS9iawSxeohwx7ID 7OQ2WjicVpI2vfpcKqu5GvvcIAZHwbVj9ogWJ+NnNrdlOOtjtpAocGa4+ 9N3LhvacdD/BEaZwRkMYOucc5+lDS8AL3vu6Lr3GmX40Nehl0vjo3e0Mv oHAOkDpQXkL3hGVQWbp10l4JyfttaRSWsGmsx8Za04tMPiHnwv9w+RXSL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644537" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644537" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:23 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700918" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700918" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:21 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Rodolfo Giometti , "David S. Miller" , Johan Hovold , linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-usb@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 08/10] tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool Date: Wed, 4 Jan 2023 17:15:29 +0200 Message-Id: <20230104151531.73994-9-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105644270479126?= X-GMAIL-MSGID: =?utf-8?q?1754105644270479126?= Convert status parameter for ->dcd_change() and uart_handle_dcd_change() to bool which matches to how the parameter is used. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby Acked-by: Rodolfo Giometti --- drivers/pps/clients/pps-ldisc.c | 2 +- drivers/tty/serial/serial_core.c | 4 ++-- drivers/tty/serial/sunhv.c | 8 ++++---- drivers/usb/serial/generic.c | 2 +- include/linux/serial_core.h | 3 +-- include/linux/tty_ldisc.h | 4 ++-- include/linux/usb/serial.h | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c index d73c4c2ed4e1..67aee758ac1d 100644 --- a/drivers/pps/clients/pps-ldisc.c +++ b/drivers/pps/clients/pps-ldisc.c @@ -13,7 +13,7 @@ #include #include -static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status) +static void pps_tty_dcd_change(struct tty_struct *tty, bool status) { struct pps_device *pps; struct pps_event_time ts; diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 07b4af10a7e9..76536c74e907 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3250,11 +3250,11 @@ EXPORT_SYMBOL(uart_match_port); /** * uart_handle_dcd_change - handle a change of carrier detect state * @uport: uart_port structure for the open port - * @status: new carrier detect status, nonzero if active + * @status: new carrier detect status, true if active * * Caller must hold uport->lock. */ -void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) +void uart_handle_dcd_change(struct uart_port *uport, bool status) { struct tty_port *port = &uport->state->port; struct tty_struct *tty = port->tty; diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 16c746a63258..7d38c33ef506 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c @@ -87,10 +87,10 @@ static int receive_chars_getchar(struct uart_port *port) if (c == CON_HUP) { hung_up = 1; - uart_handle_dcd_change(port, 0); + uart_handle_dcd_change(port, false); } else if (hung_up) { hung_up = 0; - uart_handle_dcd_change(port, 1); + uart_handle_dcd_change(port, true); } if (port->state == NULL) { @@ -133,7 +133,7 @@ static int receive_chars_read(struct uart_port *port) bytes_read = 1; } else if (stat == CON_HUP) { hung_up = 1; - uart_handle_dcd_change(port, 0); + uart_handle_dcd_change(port, false); continue; } else { /* HV_EWOULDBLOCK, etc. */ @@ -143,7 +143,7 @@ static int receive_chars_read(struct uart_port *port) if (hung_up) { hung_up = 0; - uart_handle_dcd_change(port, 1); + uart_handle_dcd_change(port, true); } if (port->sysrq != 0 && *con_read_page) { diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 15b6dee3a8e5..50016ee1026a 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -608,7 +608,7 @@ EXPORT_SYMBOL_GPL(usb_serial_handle_break); * @status: new carrier detect status, nonzero if active */ void usb_serial_handle_dcd_change(struct usb_serial_port *port, - struct tty_struct *tty, unsigned int status) + struct tty_struct *tty, bool status) { dev_dbg(&port->dev, "%s - status %d\n", __func__, status); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index fd59f600094a..f1b69a36bb2b 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -896,8 +896,7 @@ static inline bool uart_softcts_mode(struct uart_port *uport) * The following are helper functions for the low level drivers. */ -extern void uart_handle_dcd_change(struct uart_port *uport, - unsigned int status); +extern void uart_handle_dcd_change(struct uart_port *uport, bool status); extern void uart_handle_cts_change(struct uart_port *uport, unsigned int status); diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index dcb61ec11424..8f4a684973c9 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -170,7 +170,7 @@ int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass, * send, please arise a tasklet or workqueue to do the real data transfer. * Do not send data in this hook, it may lead to a deadlock. * - * @dcd_change: [DRV] ``void ()(struct tty_struct *tty, unsigned int status)`` + * @dcd_change: [DRV] ``void ()(struct tty_struct *tty, bool status)`` * * Tells the discipline that the DCD pin has changed its status. Used * exclusively by the %N_PPS (Pulse-Per-Second) line discipline. @@ -238,7 +238,7 @@ struct tty_ldisc_ops { void (*receive_buf)(struct tty_struct *tty, const unsigned char *cp, const char *fp, int count); void (*write_wakeup)(struct tty_struct *tty); - void (*dcd_change)(struct tty_struct *tty, unsigned int status); + void (*dcd_change)(struct tty_struct *tty, bool status); int (*receive_buf2)(struct tty_struct *tty, const unsigned char *cp, const char *fp, int count); void (*lookahead_buf)(struct tty_struct *tty, const unsigned char *cp, diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index c597357853d9..6fa608cb4d98 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -372,7 +372,7 @@ static inline int usb_serial_handle_break(struct usb_serial_port *port) #endif void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, - struct tty_struct *tty, unsigned int status); + struct tty_struct *tty, bool status); int usb_serial_bus_register(struct usb_serial_driver *device); From patchwork Wed Jan 4 15:15:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38973 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197185wrt; Wed, 4 Jan 2023 07:17:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXstjfXNXdqn82T2CtH0wIQDOyGoeHcS4lD/pByFw0WY6SXfMqEKHZMqwHYsA+OMEMIFJZfF X-Received: by 2002:a17:907:b686:b0:7c1:7c3a:ffba with SMTP id vm6-20020a170907b68600b007c17c3affbamr46585456ejc.35.1672845470322; Wed, 04 Jan 2023 07:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845470; cv=none; d=google.com; s=arc-20160816; b=KHFSRu/KB68MzxIXQPe2ZbywR8oL1yEPyyqxfV37MOogbl92j1v7yXengKwhGxBvYX itPoh9m7FJJ69J0iQrnbe9NF8+9AU9SbjW5DNACIaC69PhIlIcnZ4RO+i+6pK9BeTHVS ndkIaB9LrSGd/KvOOm5agGnAIgbc0BIW0mzbhyKBc6WAQOAFXSsdxmvMuPGZ2J6C8xvk xsFc5DYIfMQKO/hdKcwaswKJ/BSdZMG77PkStrXn/zDWGyBzdE0xnX/GlZGsn2uDKKyG 7ivojYAyYdHP8NktIrFNS2cUSxMg8Qxfn2GG7d0HMvOPACF3bQY5peGwKXqYqcqLEU3+ 2Jag== 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:from :dkim-signature; bh=Wb0ZEzUBNrMfBxRsRWmacNWEVceEQIdKSake9E/7rmY=; b=wHFGx6EJospNqtUQoVodA4S0bCw7jATgXiaCIVNSvQRZSXJsdGIaeVHROLXbtrNJV8 ovil0ocRIkW1NJc8vLhGC8zqNdJ0QcQHaeB+4cA/J1AjwO0YRyCAm/D9LYaG3d2WvNZb bGS2htjVtURn5+ydhxH0IIMYAndi78zd2DdZC7EgkCo6N7b+PC9AgVTEvatH8vjJuojp Ra+SQDG1cBglIk7tEBQn4zyed8fjoNHtdmhp581vcj0XqRFrsuP0eFdJop+5zRdvXawK zCdGE1K3PHD0DSyMDoKK3F0X6guzh28KXtUFAHI0JpwdkGe4snjWjWq0uUE6tSIQwsXH 340Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LdG3Qsly; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr25-20020a1709073f9900b0083fc624aedesi480407ejc.231.2023.01.04.07.17.25; Wed, 04 Jan 2023 07:17:50 -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=@intel.com header.s=Intel header.b=LdG3Qsly; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239642AbjADPRG (ORCPT + 99 others); Wed, 4 Jan 2023 10:17:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239606AbjADPQv (ORCPT ); Wed, 4 Jan 2023 10:16:51 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E88252AF4; Wed, 4 Jan 2023 07:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845410; x=1704381410; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FoqobpN/XyZOt6RH0jMAVUy4b82570kSmzhqiLl+O90=; b=LdG3QslyK49dN4+AMcSrL1lMlTmtijWgK2QFnYx4gKQBVr4psy4Z0lAE c1Zt5Dde2AJlslNpOj1nHrDX1yUlXGrQ6yj1NoUdoxnyeMp5fFTbLJ8NS NwPQiVB+/A/7PLuVWsmx3jcluHsdii2qN18ND+pc9RZ9TN9VxGPagHZQR RVSMkmMwxRuuReNRaoS4w4KOF/5Gm1mzo6LmUGHHnhmqq+BNRMiBSWUPR GqH9mxEArzESz2YrP2AAY/aNt7fHdz3gWc+sr1txZlKH6HYnilcscLaVz xRBgmOPa5PE1FJE6eeGCGEX96C+u1as6S5dnZNWGU2AeY/H0gtB13F7zr g==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644557" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644557" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:28 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700930" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700930" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:25 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 09/10] serial: Make uart_handle_cts_change() status param bool Date: Wed, 4 Jan 2023 17:15:30 +0200 Message-Id: <20230104151531.73994-10-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105611771736888?= X-GMAIL-MSGID: =?utf-8?q?1754105611771736888?= Convert uart_handle_cts_change() to bool which is more appropriate than unsigned int. Cleanup callsites from operations that are not necessary with bool. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/imx.c | 2 +- drivers/tty/serial/max3100.c | 2 +- drivers/tty/serial/max310x.c | 3 +-- drivers/tty/serial/serial_core.c | 4 ++-- include/linux/serial_core.h | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 757825edb0cd..07850a9cde61 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -771,7 +771,7 @@ static irqreturn_t __imx_uart_rtsint(int irq, void *dev_id) imx_uart_writel(sport, USR1_RTSD, USR1); usr1 = imx_uart_readl(sport, USR1) & USR1_RTSS; - uart_handle_cts_change(&sport->port, !!usr1); + uart_handle_cts_change(&sport->port, usr1); wake_up_interruptible(&sport->port.state->port.delta_msr_wait); return IRQ_HANDLED; diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index bb74f23251fe..86dcbff8faa3 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -247,7 +247,7 @@ static int max3100_handlerx(struct max3100_port *s, u16 rx) cts = (rx & MAX3100_CTS) > 0; if (s->cts != cts) { s->cts = cts; - uart_handle_cts_change(&s->port, cts ? TIOCM_CTS : 0); + uart_handle_cts_change(&s->port, cts); } return ret; diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 4eb24e3407f8..e9cacfe7e032 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -819,8 +819,7 @@ static irqreturn_t max310x_port_irq(struct max310x_port *s, int portno) if (ists & MAX310X_IRQ_CTS_BIT) { lsr = max310x_port_read(port, MAX310X_LSR_IRQSTS_REG); - uart_handle_cts_change(port, - !!(lsr & MAX310X_LSR_CTS_BIT)); + uart_handle_cts_change(port, lsr & MAX310X_LSR_CTS_BIT); } if (rxlen) max310x_handle_rx(port, rxlen); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 76536c74e907..35fff37e42bb 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3285,11 +3285,11 @@ EXPORT_SYMBOL_GPL(uart_handle_dcd_change); /** * uart_handle_cts_change - handle a change of clear-to-send state * @uport: uart_port structure for the open port - * @status: new clear to send status, nonzero if active + * @status: new clear to send status, true if active * * Caller must hold uport->lock. */ -void uart_handle_cts_change(struct uart_port *uport, unsigned int status) +void uart_handle_cts_change(struct uart_port *uport, bool status) { lockdep_assert_held_once(&uport->lock); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f1b69a36bb2b..591224505cb4 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -897,8 +897,7 @@ static inline bool uart_softcts_mode(struct uart_port *uport) */ extern void uart_handle_dcd_change(struct uart_port *uport, bool status); -extern void uart_handle_cts_change(struct uart_port *uport, - unsigned int status); +extern void uart_handle_cts_change(struct uart_port *uport, bool status); extern void uart_insert_char(struct uart_port *port, unsigned int status, unsigned int overrun, unsigned int ch, unsigned int flag); From patchwork Wed Jan 4 15:15:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 38971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5197086wrt; Wed, 4 Jan 2023 07:17:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjSV5iDeBXQLi8HNP1ouf2xwWFlzfKTc0vZOZN/Xv4sb9pd1ndGG7Q8NiOGhlASEfJpIpe X-Received: by 2002:a05:6402:5296:b0:461:dd11:c688 with SMTP id en22-20020a056402529600b00461dd11c688mr44888598edb.9.1672845459071; Wed, 04 Jan 2023 07:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845459; cv=none; d=google.com; s=arc-20160816; b=avPqVo54EkeMj3ijvsF/YcTvxKxmrAzoG1GNr6XZSkHgHMX63CcXssAVUcmy7+jOB6 7AB9lHwKkTHvuZPFUgrNWFLqns0DDgl3ZiSRA743R7gpMwK3iIBLzwuaGPsxU7oHPibm EJDmgvNrPyFlo5y9stVRvNvohqE04db3JGM2ebg4lQ94w9AJt/mXGltPsCy4Ghv6cLZg sx0VY8r7gQBwAJIJNqqiyD5fKc3tOQUNTePmiRTChLrv+HvbulJp7j/YSxfxXxrNIAmJ 0UjjtNPjXKdi8qFNqfPZU3hzHX8ZFf/OZE5Rc76eyvPzo2HxHnjsDby30FPTLcz6L9ST gK7A== 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:from :dkim-signature; bh=AUtKQJ4veOaR3bDkZ4aV5qlxfc+bhDkqxsMQC+C+WV8=; b=BDKrwzGodvjhXLkeDcvqvHDIdhOXYoTp0kInX/CSDGhmIz4f6rGFon9Kh7S6J4eHgn vtjxCMYc5DQ/NZL0EQNnh59vGyXRFM94aSovaT9fABYaHKZnSjBCkfS5yk0FlngAisAs ZIGW/BH9zKm39n9Pva0OjN7VhGsjGsKwYUEScg0iiedi7ko7qxWj1W1y5+7CJdj3E3ev E5UfRi/LFHmn5nnbudV5C6pKujYLXSo+R464hvl0TkiILdBy3NmAz4nqtPh75a/yiv2l dleS6GQw04Zmn1bPu4WpqYqeYc2HgaBCMGRChe1Oij5jye5o/LrL+klXIKCLpXgZMWVc 7GLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QBYZIFKC; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a056402348300b0048edf59946fsi3662374edc.19.2023.01.04.07.17.15; Wed, 04 Jan 2023 07:17:39 -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=@intel.com header.s=Intel header.b=QBYZIFKC; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239517AbjADPRC (ORCPT + 99 others); Wed, 4 Jan 2023 10:17:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239613AbjADPQx (ORCPT ); Wed, 4 Jan 2023 10:16:53 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F07E61A233; Wed, 4 Jan 2023 07:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672845412; x=1704381412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JjjW6dFqxPvZpMJtTa0hvemI7uFSxCRu5bewJdPlkFg=; b=QBYZIFKCp4RDHI2A6skJ/DtzCZHQj9LMjTquXytZElrH7U+3pXATraT/ RHxXRv3sRv3stjRNhYcx+TIw3zbVgftn74S/vrYUx4mUgyX2FuNPmp63Y A4dBssryqVjvLwqVCzpqUxjaBf2GSLDk6Nk5wUgnynhpus4gGj4xsXqyf afLz4IywQvKoJJbmbPJvunaeRIYjnL9GfT71Mcyugx9eUgrp6dU9o171N q8wNALk5Qhgm2JZ9+MyYRHfH6KOtCwW06jct74FXZOA/NpriYnCoQxz1D 2x7Aar09FhptoTCUGRD5IiwlI22GJJxeViXy34c1Yzz29TZKLeS8+jmyb A==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301644574" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="301644574" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:31 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="762700952" X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="762700952" Received: from msvoboda-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.48.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 07:16:29 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Cc: Johan Hovold , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 10/10] tty: Return bool from tty_termios_hw_change() Date: Wed, 4 Jan 2023 17:15:31 +0200 Message-Id: <20230104151531.73994-11-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1754105600066658820?= X-GMAIL-MSGID: =?utf-8?q?1754105600066658820?= Change tty_termios_hw_change() return to bool and convert it to a or-chained return statement. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/tty/tty_ioctl.c | 10 ++++------ include/linux/tty.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index ce511557b98b..4a80fabf6d5e 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -270,13 +270,11 @@ EXPORT_SYMBOL(tty_termios_copy_hw); * between the two termios structures, or a speed change is needed. */ -int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b) +bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b) { - if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed) - return 1; - if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL)) - return 1; - return 0; + return a->c_ispeed != b->c_ispeed || + a->c_ospeed != b->c_ospeed || + (a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL); } EXPORT_SYMBOL(tty_termios_hw_change); diff --git a/include/linux/tty.h b/include/linux/tty.h index 730c3301d710..093935e97f42 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -453,7 +453,7 @@ unsigned char tty_get_char_size(unsigned int cflag); unsigned char tty_get_frame_size(unsigned int cflag); void tty_termios_copy_hw(struct ktermios *new, const struct ktermios *old); -int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b); +bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b); int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); void tty_wakeup(struct tty_struct *tty);