From patchwork Wed Jan 11 14:23:19 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: 42022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350539wrt; Wed, 11 Jan 2023 06:25:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXuFfl8cMA9la705lof3ydTJQF6V5ezX8q7sTA95E4v3L3fXXZLpc3aI4gNgaQezys7qz+Hi X-Received: by 2002:a05:6a20:cf57:b0:a3:5864:e0c5 with SMTP id hz23-20020a056a20cf5700b000a35864e0c5mr2798384pzb.9.1673447127274; Wed, 11 Jan 2023 06:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447127; cv=none; d=google.com; s=arc-20160816; b=MJJ8wnZAjFvAai9UYuaIbYGlB/bf/NCtj5eRM3h9R5jw4jR9VVnotXG2yXWAxfzeNT fF9bwqC0K3ZmrLjUL4zzMFLhEfmBVB0Af43OhLDc47tvLAGBTJeN11fgnTSL0H5Kvtoo lmMFGBDhUI93TegW2k+7GBuHVpvb5XTSIIDY5d/ZDfn0DEhnURcxoKAdSd/3nD5k5qIS K7Q8kCpvJtGw6Hs/eB1BsjfK8S9u0kW39I5zqrhnkhM/rwmSp+CF3W/wx87hwIDmPJkJ gyGj3CF7oLUlMn5B/Epgw5Q4kaO5PgrKifQwEqMRr2Y3j+YGkD4/j5zTNAdMGMLN8xsA 5u3A== 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=tFh+Md9ZRxwtOHBLolSJUlBF29BTAFiFhVuHiOr2P2k=; b=ZFOQxN7Er8kj++6jGk+1zUdXKeadX0mxZ6Mb7XpOLwaf+PvNZRTrpEZPlcYoQj011n /ul5Uvmyn/yp+IJSD39nvWaw6DDbOnYkM32ISFTAnUgq4VuWHeNZbsHzebiyeKjePkwp gkOn6VjI+fwkzAcNNA48i9aW9U0jSNlwmm8xqWaAiG/FPpFkRb3RgeCwqEamG/hC+i7l dhKDiL6kCt9PxqPIzAx0Pb9NhKLCPXZ6FbSsyx4N+/Mx4L9Qkh4V3kMabqls8Z4l8WvG /+Ri5kBr0RGKSv6nVRSYuUaydHwvg7E8nOnchawFmy9Jc/VeLy0/3pOtthYyWAy1ygbl YvnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X+RjQDN1; 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 j12-20020a056a00174c00b00580d9a62ab8si5838760pfc.184.2023.01.11.06.25.13; Wed, 11 Jan 2023 06:25: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=X+RjQDN1; 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 S238839AbjAKOYD (ORCPT + 99 others); Wed, 11 Jan 2023 09:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjAKOX4 (ORCPT ); Wed, 11 Jan 2023 09:23:56 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B35015F38; Wed, 11 Jan 2023 06:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447035; x=1704983035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Bs/QxT4h0CrR67dsOJolQlUz/QoNMMNB9GCwsyLDTrY=; b=X+RjQDN1vS4PrQA+D4kupwIjOYW3lpxeOOcn7w2/vFe5o2MXy3lxh4s7 3Ocq8WtB00FrGLx484N0ScAZvOdQfC7v/1hSwKlqNYI3lspc00sTo66WK NhKZgHPiIZYlIPrQdgSUWf9EXFHvhbZ+KuDk9iau56usI4hFysmdu9zo5 7HNJ0VAgM+aDH/mACUrhGIkLrRwBGBsvG72e4wJ3Zuk5yon6qS6Rzu9LR UR5TcmYuJ/iFmWSXKH8PtHlt+bg8JKtQwFTEfcYNFSlwZsxB/oSxP/Jy2 uEE3MMuQXXmUZmSAeeJYhisLAfExvvFXLazzCQEJFEbHsW0eaX51R36ec Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793453" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793453" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:23:54 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381795" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381795" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:23:46 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Arnd Bergmann , Jens Taprogge , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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 v3 01/13] tty: Cleanup tty_port_set_initialized() bool parameter Date: Wed, 11 Jan 2023 16:23:19 +0200 Message-Id: <20230111142331.34518-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736494851203201?= X-GMAIL-MSGID: =?utf-8?q?1754736494851203201?= Make callers pass true/false consistently for bool val. Reviewed-by: Samuel Iglesias Gonsalvez Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- 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 11 14:23:20 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: 42024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350756wrt; Wed, 11 Jan 2023 06:25:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXt3asBs+8L2FKEZfY7va49LPZtwFiGhWggACsu1kehMXi4OFHDg0bnTqUrml6xHj9eiTV0T X-Received: by 2002:a17:90a:5206:b0:226:bcbe:dfc0 with SMTP id v6-20020a17090a520600b00226bcbedfc0mr24599051pjh.27.1673447151816; Wed, 11 Jan 2023 06:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447151; cv=none; d=google.com; s=arc-20160816; b=cQhE8KFF/czj76cs2n02R+zZX3moBl2TYLt6dnDXJBwWqQsVpAcr4kuH5nTUMLvF1o JKCVbq8SAYEefhLXYafdJxAUti474mE+Net/tC0rFEfjPIXsbElItimK6s8rU+RBKppb 0f5IOtajSXeifeC9JeGaTz93ZE0y9CoDjwpZO1YBWLpiQhPhE5bf4MU6qT9Fav6YHR0N AxPMrP7fS9Om77TXaZbsX9ERlW4W98/eCR7Y3KAWncmVdLx6+A5kiylgh22qNTh7bsYM 1SE+t8p8MQ/sn/AWsdDxIaWm8ipi7JmGH5m4T3TXvGbmoeoX2JZCoyhw/qvOA8kJKQgh WECg== 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=2bZ5OSlOkdHjMRaRadWLcfV8ihWK8AbXZXzVn08J18o=; b=CQ42ZpO/plTCBqRTNSUh0tC2c6KyYvOmUtIghMa0tFw+kljwRdHT2qb38YlgNLANJp OQDJj6t8sMxZNZz087ui8QpGn3X9qgS+/IPZW208tgucek/1HIDPs+POt2rxGbQUVgOK 4fwHs1gKAT8JYXqgsv3vSIuY7aHaRKatsEnpKr3Su1FaQPAzBRlyjHd/ugHf+XJ5WR4X BfomE9BzQq9jUtibRIpU9VUKYoyk4UON2dvYe9b/ev46/zZfEVLi+gQ5EMyufKAboH7J mKNlsbpP34XatGOQT6nU3GwmnnoZWhmWZQVBW3U8/iNs4XAa0D2MIn0PxJWo3nve+Eiw EJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UIjyqdi3; 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 u2-20020a17090a5e4200b00226e74464f7si13383355pji.108.2023.01.11.06.25.39; Wed, 11 Jan 2023 06:25:51 -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=UIjyqdi3; 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 S238398AbjAKOYg (ORCPT + 99 others); Wed, 11 Jan 2023 09:24:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238514AbjAKOYA (ORCPT ); Wed, 11 Jan 2023 09:24:00 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C3513E9F; Wed, 11 Jan 2023 06:23: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=1673447039; x=1704983039; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p/abY3EvdT/9LBFynpim0jdmH9McxhRPFImaHI0+/DE=; b=UIjyqdi3BN9L4IuMfCqblGC+eT35JJVmn9Pl34I9XNSdaUBeierao895 m3DbaXu1YQJ4tW9zDaHfTw/O9X1tjdkMjDqtCmDH0LnzNYljhAfTsuvBK PlraWJqLabSBddseAX8ZjSBYGFy+Q9se7XKv3ehG5DAV/4+2onnyMawXZ GZLyzc/ggAKYmso205WIZhDG+BLNWfJr+4CtZvqMbt7g9FZKA8+BOowRP 57Pz708O8zCSCQ/hw2CBcL6N1nOE1lxkfWReBTywqEyARg1nlbv+thXRa o/ENB31KOTDJACRGO5DEQvZM1zOujH5CCD++rfuf970ltflHG4E7waS5u w==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793478" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793478" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:23:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381830" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381830" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:23:55 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 02/13] tty: Cleamup tty_port_set_suspended() bool parameter Date: Wed, 11 Jan 2023 16:23:20 +0200 Message-Id: <20230111142331.34518-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736520839686242?= X-GMAIL-MSGID: =?utf-8?q?1754736520839686242?= Make callers pass true/false consistently for bool val. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- 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 11 14:23:21 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: 42025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350754wrt; Wed, 11 Jan 2023 06:25:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/1urf1VrOq08y9amL2atN8mVdv8aRCSOdyVuAroGeXKW39BLzo3NM15eERwr42o1a8lno X-Received: by 2002:a05:6a20:5496:b0:b6:157c:d72b with SMTP id i22-20020a056a20549600b000b6157cd72bmr8496071pzk.33.1673447151862; Wed, 11 Jan 2023 06:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447151; cv=none; d=google.com; s=arc-20160816; b=fgZxpF8LTOpD5/YwOGUx2/k/U2OzIKAjE7FVz1HBvl4TNxjyBrnv6JyJc2bpT68uE9 QvGxaZ2D0LcrlO7CbKVtfsZVZUOgqaSXH6fqJtKZI0wOK5RNXxPtpN26Q2zyMLjVnTh2 VFoU1DDLOPuYJUFBfWKFomRBGqOifpaB7iOK58N1FMwvBWF/PGbnSDgSlJf4XbHmqwMp K0v2QzdIvRPvw3hwkkDEPTgudz1XQxqI/i2RnWUuwFMseQHwnUZDWV0bV3qf2Rs+hT39 KGdJ3Z4ihe60aANrV3Yy35o73KJtLev0vtOmUoI5+3TyAg44QgRSWHEs694FIz8ZYuVG /UCA== 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=eNMxdXx2eCKmjzRm2H2E9eRBDXWhcs0AF6N8GrbDP/A=; b=MXS6sAK9TteUQewFOBPbwtQfY3g+7G/P2LRXZhS0gNAQmjweaTbH+M+9UxcXCoHkK7 KJ1Nba23nxH035T1st7QCVXdWQQLuZtTMsUNTw6VgD/jFzYorkrsWsnCdJcsSgTzXDy+ MjggTfHi/p6jCj87Zg4lV2IFnHI6ZgGDaVZhXqdTcx9pyYscR/AUaUxqfo9r5cxe4F5C jzisqqXwHNRrkxF5zO+WqDSerEUKWfUNobQ9GbP4B6iZSFXQ61sw5uhGwXLb/nM3XaH0 E+6LNEG+GVwpvZhEPJZBcc9Je2pU96UVgSgQS2RtT2njq0YxQTdatlp29e/+hIwJG6bE hMAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhqI0iZD; 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 x5-20020a654145000000b004b1e9747647si10158396pgp.675.2023.01.11.06.25.39; Wed, 11 Jan 2023 06:25:51 -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=ZhqI0iZD; 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 S239094AbjAKOYn (ORCPT + 99 others); Wed, 11 Jan 2023 09:24:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239150AbjAKOYQ (ORCPT ); Wed, 11 Jan 2023 09:24:16 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94FC19C1F; Wed, 11 Jan 2023 06:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447043; x=1704983043; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Aq/Xj7/nsyjOJJNoCoUIoSWFh6jWuFSd4E8dlq/Esx8=; b=ZhqI0iZDZ8sbbDLmodp6Lw+FHU9KE2Kre5w7XQEEsCbmvioRqfJl4I0A q1XIRpdxM78W+iNhDRIXwe9CMwSh97iext5h59y1XVYhcxhcrvx5gEKy5 N8CsFoNUZvcGwJkvdBAMg/aCJx8pzaJ5z9rhnWR8xxh5ZhJ/Fxf2Io+xM zwn2tV1Ot7qzmA5PWB+P+Hk4veDsUCq0vTy7/YDMOAg8d1yTETb0UON3j Q9uvVyS2GrPVuzzkDyaJp3XhPYFbK58zNVIBdGPSHSJeUyVLHmiRSUz64 BmYLKFEDg1dbf61KLedWDLGEkzN2yDYvagIvtRyCOW6rvJpN7LB0zycV6 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793499" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793499" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:03 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381842" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381842" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:00 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 03/13] tty: Cleanup tty_port_set_active() bool parameter Date: Wed, 11 Jan 2023 16:23:21 +0200 Message-Id: <20230111142331.34518-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736520514884330?= X-GMAIL-MSGID: =?utf-8?q?1754736520514884330?= Make callers pass true/false consistently for bool val. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- 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 11 14:23: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: 42026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350760wrt; Wed, 11 Jan 2023 06:25:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3j5rlqiQVyx/pUj62IcMgc9X9wyhVdfMbgPaQW/uBGQiBiqzHGGofGksHsNNlAjXubHPK X-Received: by 2002:a17:902:9348:b0:190:e63a:ea91 with SMTP id g8-20020a170902934800b00190e63aea91mr69159507plp.0.1673447152478; Wed, 11 Jan 2023 06:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447152; cv=none; d=google.com; s=arc-20160816; b=YbPwPtocccjzrCV+Gkt6NXcpwtble57YI2IMbSOetQPJrCSqZS+QDLxViUFmLbgNco tfrx3/vu9MjcyyVZwiGOPyCAyIk8/ktsdvkk1/VlOArReky5X9Y306+fjzPejit/o+yK Lxas2bJwXLMQfA+wGzuYYILEBWWSJDJjxQnED6Vc22UW9ZDuTTe1Oe9GfrP6Plw+i7h7 H3yK++uyDF2gQ6y0aLGPySDTXrh4K4xCXizjM0JKyF7W4OMfX879HwpxGGrSyMGipMcK A4AhZ+Kyu/HGVbBCls1sskC8F4H8FUX7cWPLCasxvfOlwfeIb4FkbYerKsLhcZv2N5tk 3bSw== 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=Svga7SsiFsN5UXzPSuWC3QCdzpcdEqH2j+9/f+MZ4Lk=; b=TkOAaz/U/wqf/EgW0NjBKsBYRbl0BWIqLFaDAVjSh88TzUbIM1RT/ZcmYDjI6mjYAy Zh50KHmNhRBFr+nlsBXl6BKaAcSxDKuZDbqu64Im8tz2rfJSvmB5Srv7f3+9Ov18V+GQ gT69UI6OkD1RHfgpjDGa3kJFhxcKqcc01Sx0y2nEjW+tIGy8Z7X8tfkAdv3cvfGz0rY9 R4pohjZpqH8VcUrTz/DjcZL3uTuXQnESj4nZgCHOgWk0gu3YAPmXDg+mN1U19lAk7PJQ Ou71gdfqFwVifnvjzJTcIVzfc1smD3Jo6mLVioysVQHX2mGSPfhRPt4oYyf1c6c5831A 0FCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bQ92uKsO; 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 e34-20020a630f22000000b00477c62b9498si15140120pgl.212.2023.01.11.06.25.39; Wed, 11 Jan 2023 06:25:52 -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=bQ92uKsO; 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 S239288AbjAKOYt (ORCPT + 99 others); Wed, 11 Jan 2023 09:24:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239175AbjAKOYR (ORCPT ); Wed, 11 Jan 2023 09:24:17 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70DEF1A066; Wed, 11 Jan 2023 06:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447048; x=1704983048; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0aHYPToS/jABucyxHBUjjp3ckI/iQBTA/kh5jyn5eAU=; b=bQ92uKsOT37n8E6obUNT7noQVBMmrfewEHoPtgCgg3o1ZP6zL4kRbFkC aJSkzKnn3cZDbNeNKi5fncyoTWPeR7b3Wpo0ls62kaXVhpoQZRMNB6a3k ikmUbD1tRfM0T91yvAE+dke7jRaPnOdSEZopw9BEHEKRxP/dnbiSastIK zrBRE90neL0n0HheVxFYB6lxQLMeUQRgnKXsPyE+3eFJxzN+PY/k/3OM5 8VrMvSakJTlZ8fthGxpMUDDWhamTRHuwEz0CVA9gSXPKKnMI/uxcnAfQb O/4YG9rLpnn4FWVjB/905avP/UZ1HaosJvT9NuLBzdUGXUfg4GjInRL6F A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793524" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793524" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381853" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381853" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:04 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 04/13] tty: moxa: Make local var storing tty_port_initialized() bool Date: Wed, 11 Jan 2023 16:23:22 +0200 Message-Id: <20230111142331.34518-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736521125601480?= X-GMAIL-MSGID: =?utf-8?q?1754736521125601480?= 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. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- 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 11 14:23: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: 42023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350752wrt; Wed, 11 Jan 2023 06:25:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEwotAHYstIQLPyrF97IT/Qj+XZ3aaeZ8rthXD3u8Z7AngF5sjt7j5YiT5u43KWn1xj7Vp X-Received: by 2002:a17:90a:b891:b0:226:eac4:b22e with SMTP id o17-20020a17090ab89100b00226eac4b22emr17774903pjr.8.1673447151813; Wed, 11 Jan 2023 06:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447151; cv=none; d=google.com; s=arc-20160816; b=ExirBDRclHM/UC+/JkmI3xn8eyz0ICgP5oL6tCb+Zxex+wnl5zLMXbtJFSSExBgQzU nc2a5DOFR65hSA/EtZoPefgTZ6mgPFwwv6eeWZA8gCj4iORziqbC7WoHKURTUkSqnTCq iDw2/Md9tWu8xi5hDDkl3iEWEEUcFOneHdZ9X8agYj7iPbqS3UY7OW/WbB3jW8iXbGZ1 KKUInesMq3oMlh+Brp4fbVW8KPvlhOJZQgiVjqXkD469UiVkEM8ja0jV/hlNAD3BRhqU bDCpa7o7EyWOj/R71stdJAVVi1aYUpklUr7aBPDxIw5+isofaLO7O+y8tORhNqAQO4F2 9LFQ== 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=i06EV4nHhLxaLlRHoX6TbWaMP9ZwXMoShANYKAvvwBs=; b=hFBdw1YoKCeQMzoU8vGOZdJcYfHrmh0GDzjSYwhnjKjcG1iF7ulxLK3+8UCEU+daoQ asnS6pHVgF7W4YkCUVRs7wyZlSfss7LzZ3/+eybqBa3Q6sobsQsq6L3LI2IH6O+BQATY ZJcpMJZYafFIEfY8vsvbFRtXMFQYJGxFcRBnnD1VVT7kNMCZTUjRbSb4x3WzQvWu8G6K XjQ9DuEJPFm9/qkCdlWr5BFkXGx3dG6igmE5hQKHWdhqF7g/tbcZsAzARFAvxgN5DX0o 5JNV0KzNe1ZxNOvvqktQmDuca3REfvKd1Oe3/IqPGMkrsersYVA+vomdFJiPYTUnx1TB T+2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mj5SvfYe; 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 np7-20020a17090b4c4700b00226a71afb9dsi19956887pjb.107.2023.01.11.06.25.39; Wed, 11 Jan 2023 06:25:51 -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=mj5SvfYe; 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 S239346AbjAKOYx (ORCPT + 99 others); Wed, 11 Jan 2023 09:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239246AbjAKOYT (ORCPT ); Wed, 11 Jan 2023 09:24:19 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70651B1CA; Wed, 11 Jan 2023 06:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447051; x=1704983051; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I6INK+vllASz81Q/lAEuJEpKu7fwlusgKRFEwe90IfM=; b=mj5SvfYe+/pZrKXRzr6ejYyaIg2m5e/ETmg6PDRFw3A77akLheC91Wkv 9NRUgmAsLPSHs6oMsLOT8Y3skSKHk+5i84RJeJIXVrTmSWlGeyW/ZZUYX svv2wyARh1ibf+XLkBQOQ0mDBFYEzRe2CfqF2+3QZ0oUuw5212MKnrlPr LE69Q1zVDZuXfWe5PMoG1/KlBUHr8JUXz8MA2KTYKSFx3gcAWYTTfTLOD JRR4yMAF3d1LFJHViqCPPDYEGDTZZfQmg91aGIY1b2TgFsUGn9tR+FBkM fQTm/ZIf68vp0zjTfyXIMftFrhESpm0ci6yijNQLUyqjjZT5d/PLgyaD4 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793552" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793552" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381870" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381870" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:08 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 05/13] serial: Convert uart_{,port_}startup() init_hw param to bool Date: Wed, 11 Jan 2023 16:23:23 +0200 Message-Id: <20230111142331.34518-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736520788864446?= X-GMAIL-MSGID: =?utf-8?q?1754736520788864446?= Convert init_hw parameter in uart_startup() and uart_port_startup() to bool as code treats them like bool. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/serial_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index c881fefa3d97..f7074ac02801 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -182,7 +182,7 @@ static void uart_port_dtr_rts(struct uart_port *uport, int raise) * will be serialised by the per-port mutex. */ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, - int init_hw) + bool init_hw) { struct uart_port *uport = uart_port_check(state); unsigned long flags; @@ -254,7 +254,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, } static int uart_startup(struct tty_struct *tty, struct uart_state *state, - int init_hw) + bool init_hw) { struct tty_port *port = &state->port; int retval; @@ -997,7 +997,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 +1165,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 +1943,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 11 14:23: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: 42031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351043wrt; Wed, 11 Jan 2023 06:26:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXt5NeeGWuB/Zj4Zn8+vAPfPcTrIVcib540dxo1x8NfePDdfkAnEqaGz+9C8/5UYS8MKLduW X-Received: by 2002:a17:902:7781:b0:192:8ca0:b86e with SMTP id o1-20020a170902778100b001928ca0b86emr2797186pll.35.1673447185617; Wed, 11 Jan 2023 06:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447185; cv=none; d=google.com; s=arc-20160816; b=j/r4rOTE9yWR36R3kKoy460kSsSqfo0HtozGFBUUMxTf2i+O1nZfoSBw+5/8UdVIcP 6qEH2HBDvTNGgkYK9kC76XJ02QtmkC+XMB2pF9Gjtdi2t+o8H12dCUvXDezcm2srURiv hk8jH2sFtG8z+d7aA2cpKiI7wWfJtMx+TZWmwzmo/SVcPYt7kxounYwcpNvhnQw+Ccla GmThZdf6YJSX4cRdtq9BbsMGvgSWwdQcdt2KOS6CfPwSHTSkr3p8JiKpUnCB267UufQC V1Q/ntDDmDY7scOcLaa2lgPbB3cg2WEhXhQaSyB9ucJ9dF+7apepFDLs8jPtLgprH28J Loag== 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=MbZ6JW9YHygR6kh2PTYJvl3uTGHzK/9e5xnmOyZJFzE=; b=jUCJsCMyu6fukicyPYNB14f6cvwVxPoXKt/NPEnGTKbNxoTGTFjq/TRNPPmVOms942 msSd92YeY1Ntf/LrxygdYKKr4AVV01KLx91lH1m3BFF6JXBo1ff72dirXqVIdt8Fj86k AAFf+bfrWnlG9uIAuwWkh+WjMJqHNSIRU2yNxtOMhdUtDBQHPN9j4qWR+Rot177Ux5p9 r5lgW5fMkwAAwsPdXBrO4EDZLCseLPtwbKSoqVfQWJOMJmrwHfCSWWg6ENdcFH0z2MMb t7U+0/v3P+iuh7G5oG/BNG3aJFyf1usF8j8a2PMuALS4VtImHordsbAfhbq0C77BsV3d QkJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LiD1t2yc; 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 f6-20020a17090274c600b00190fb8f9e0bsi13746359plt.490.2023.01.11.06.26.12; Wed, 11 Jan 2023 06:26:25 -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=LiD1t2yc; 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 S239134AbjAKOZp (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239398AbjAKOYZ (ORCPT ); Wed, 11 Jan 2023 09:24:25 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EA4013E84; Wed, 11 Jan 2023 06:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447063; x=1704983063; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oy3sQADbFRuujvv2rFllSxeToIT8gEZ3Y9rn+S//QDc=; b=LiD1t2yc2/wW213A7/WftRGuesUNUuk25ZI0u3S0jU+0AKe0OAfH2MqF Q6NmVZJ1QBYSHxQgPyYQKsESnlxJjEzhiZOAR5DqFzM30J9q15fvbVbHj tvbMFy2VnEy9aFq2grFHbGhbKPsrWbvSnC5DShlyZWmiywPtDO7dhLSML /kzs3wCP+wBA+VwgQwHLcs4thRtiBqOnrpotapHc6JOHf+inpZIGwao5L +tsOz9rDfhXtxok1KQRiTEBUiXacX4Or/aIGorwsBGjQWI5eynnVNsKYS Usc8kc6jS0eXWbdFdFGzFCKCWNbJiYS22kZlY8C9qePH912Xqij/97MFQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793598" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793598" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381900" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381900" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:13 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Arnd Bergmann , Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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 v3 06/13] tty: Convert ->carrier_raised() and callchains to bool Date: Wed, 11 Jan 2023 16:23:24 +0200 Message-Id: <20230111142331.34518-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736556175292115?= X-GMAIL-MSGID: =?utf-8?q?1754736556175292115?= 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; Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Acked-by: Ulf Hansson # For MMC --- 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 f7074ac02801..20ed8a088b2d 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1861,7 +1861,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; @@ -1875,15 +1875,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 11 14:23: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: 42029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350961wrt; Wed, 11 Jan 2023 06:26:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXt8kEBhTpXTNyUt5j5isp+1keCRgQ9uOYHN4UCfZNWz2vu+PZXQ1GH04Lx7bqfv8JnFda3o X-Received: by 2002:a17:902:ab1e:b0:193:17b7:7909 with SMTP id ik30-20020a170902ab1e00b0019317b77909mr15423104plb.5.1673447175809; Wed, 11 Jan 2023 06:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447175; cv=none; d=google.com; s=arc-20160816; b=sV7p8Wwu9WCzf15vATdoHdSHRc+ur7G/xKSopv6uO7ZRXr3fG8ecPvPz6qdq2oHMlq VIMiMR6DMFMKny1NvKfzAye/X/q9s+BejVoUrgaIOZYJN05Bs4YO246XxR6FEANXW5I+ HUGByV2wkjDpSLPWxFseuKmm5eo8SHFW5dtJBxgxorDs1AMmFZcmeisd5eS57IOpM8lt wHUPQ9yEp2umah51/rhnr75J+PnGp91W5LdigBxiKcN4x3/ODATJ8P9CSIxGpoW3O8pj uPQ/VFU+13uOD3fLdwP1V0MBkdCpo18Najraj+fEHasdgN9AekuDHrHsE61heyb+QTfV COwg== 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=0WUGSd3FPNbQrcxXjIgqE7HTQPCy2Y+4VXrqTlkcrR4=; b=PPBz8f16PeGCgrvbnOMc+6w6DbhfDOecXuc0Eyp2HuhQXjbEjjMrLFOO5Mxepk0R19 O8Ivah8jJwKRzH08e9oX04dsBFTgbbKjByxGGw8mIrMTvKakOQ2EgTegeuPnVOpgsUe5 Md0dmIjUDyr5k7s/MsXPvLKGLTD235buo+ujZO1DXUjXlU4BW6xyBUk26p0yxxOK3T+g OlOcxy3GnESzOODFPwPAMkq37e3U0SYJl6dM6mO3HRJru36bbpTW1MXroCI602+ddaRv P1FyoXMH/G00fJQc0SFZiBcnIi0JqhcWzUtSuJru8Lgo3gcnjjswgJDJiWA3peSRnF6Z Hymg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RgrkwZfd; 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 x1-20020a170902ec8100b00189e2b9e630si15476265plg.270.2023.01.11.06.26.02; Wed, 11 Jan 2023 06:26:15 -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=RgrkwZfd; 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 S239524AbjAKOZX (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238480AbjAKOYg (ORCPT ); Wed, 11 Jan 2023 09:24:36 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 790A613F03; Wed, 11 Jan 2023 06:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447074; x=1704983074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9oM487Gge9nUOySFbYTpTgCIhbjnBQ4+cJwC7unkEbw=; b=RgrkwZfdFL5iGngUH7/I8gcMWK7Aahp231AiQ6li26xxfX+QcLrTn5r6 nSwL6+BZlmUAMamKreOZGd1xEoIxpQiVrRpBnoGx8i1/hxje8tt4Gi9Y7 ZCZuLBb6nqKsaX2cwZ/Nh3XjsOo1OyIBAOzVvdaqxLnKW+rgzNjcAA+yg jp+/BKZkiVYM+aSibJ3/4a3JkaCY9H9li2XRY5dRTBRGII2yYCMssBK47 yAl1bNmsCqKB97vS4MYvxfpkFB3nzUgEtMUsi4ERx885WnV5T5MY//qy6 SDhcT/ngQvYocSPcB7VQBENTgigCjKa8CcSTEvm48GjLHDGNFyTlZB/sU g==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793625" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793625" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381944" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381944" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:24 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Arnd Bergmann , Ulf Hansson , David Lin , 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 v3 07/13] tty: Convert ->dtr_rts() to take bool argument Date: Wed, 11 Jan 2023 16:23:25 +0200 Message-Id: <20230111142331.34518-8-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736545908504160?= X-GMAIL-MSGID: =?utf-8?q?1754736545908504160?= 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. In moxa_tiocmget(), dtr variable was reused for line status which requires int so use a separate variable for status. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Acked-by: Ulf Hansson # For MMC --- 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 | 54 ++++++++++++++-------------- 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, 84 insertions(+), 82 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..9be3d585d5a9 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -502,15 +502,15 @@ 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: */ 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 int MoxaPortGetLineOut(struct moxa_port *, bool *, bool *); +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); @@ -1557,19 +1557,21 @@ static unsigned int moxa_chars_in_buffer(struct tty_struct *tty) static int moxa_tiocmget(struct tty_struct *tty) { struct moxa_port *ch = tty->driver_data; - int flag = 0, dtr, rts; + bool dtr, rts; + int flag = 0; + int status; MoxaPortGetLineOut(ch, &dtr, &rts); if (dtr) flag |= TIOCM_DTR; if (rts) flag |= TIOCM_RTS; - dtr = MoxaPortLineStatus(ch); - if (dtr & 1) + status = MoxaPortLineStatus(ch); + if (status & 1) flag |= TIOCM_CTS; - if (dtr & 2) + if (status & 2) flag |= TIOCM_DSR; - if (dtr & 4) + if (status & 4) flag |= TIOCM_CD; return flag; } @@ -1578,7 +1580,7 @@ static int moxa_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) { struct moxa_port *ch; - int dtr, rts; + bool dtr, rts; mutex_lock(&moxa_openlock); ch = tty->driver_data; @@ -1589,13 +1591,13 @@ static int moxa_tiocmset(struct tty_struct *tty, MoxaPortGetLineOut(ch, &dtr, &rts); if (set & TIOCM_RTS) - rts = 1; + rts = true; if (set & TIOCM_DTR) - dtr = 1; + dtr = true; if (clear & TIOCM_RTS) - rts = 0; + rts = false; if (clear & TIOCM_DTR) - dtr = 0; + dtr = false; MoxaPortLineCtrl(ch, dtr, rts); mutex_unlock(&moxa_openlock); return 0; @@ -1877,12 +1879,12 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * * Function 13: Get the DTR/RTS state of this port. * Syntax: - * int MoxaPortGetLineOut(int port, int *dtrState, int *rtsState); + * int MoxaPortGetLineOut(int port, bool *dtrState, bool *rtsState); * int port : port number (0 - 127) - * int * dtrState : pointer to INT to receive the current DTR + * bool * dtrState : pointer to bool to receive the current DTR * state. (if NULL, this function will not * write to this address) - * int * rtsState : pointer to INT to receive the current RTS + * bool * rtsState : pointer to bool to receive the current RTS * state. (if NULL, this function will not * write to this address) * @@ -1892,10 +1894,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) + * bool dtrState : DTR output state + * bool rtsState : RTS output state * * * Function 15: Setting the flow control of this port. @@ -2103,18 +2105,18 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio, return baud; } -static int MoxaPortGetLineOut(struct moxa_port *port, int *dtrState, - int *rtsState) +static int MoxaPortGetLineOut(struct moxa_port *port, bool *dtrState, + bool *rtsState) { if (dtrState) - *dtrState = !!(port->lineCtrl & DTR_ON); + *dtrState = port->lineCtrl & DTR_ON; if (rtsState) - *rtsState = !!(port->lineCtrl & RTS_ON); + *rtsState = port->lineCtrl & RTS_ON; 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 20ed8a088b2d..053535846ba2 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); @@ -239,7 +239,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, * 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); } /* @@ -302,7 +302,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); } @@ -1885,7 +1885,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 11 14:23: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: 42028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3350813wrt; Wed, 11 Jan 2023 06:25:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvab8EdKkdmNKbkOzl3uEkwdWyMajWvutq+qVITgEjJAh322lbkn3hj8K19UNo+ObkWUh3u X-Received: by 2002:a62:19c3:0:b0:586:f44:47db with SMTP id 186-20020a6219c3000000b005860f4447dbmr17354641pfz.11.1673447158287; Wed, 11 Jan 2023 06:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447158; cv=none; d=google.com; s=arc-20160816; b=rwJ4AivRVXspWfX8q7KJdJI0IF70S+Px93ncgirB5UzxDMRiCQq89Nh6Hyv9+ONx0i vhO0Dj8NpazA243p4mdd27ABeLy2RF8vTQAUz/uZAceFCIDSITmfweZjoLycmMbiKbh7 K/Q01jPxlSnzov1QDnZ7Q192KYqrzgx38Y8ceSl7IXcFj0jtDyCkZUV6SEX9xA5cBgrK N69EeR7fxyOKqXw3rINYY1IReM8DFoUBWGXNQD6m/Qn2hXVK5Zhd7SN6CQyjc0yiiHfq 2t/ZYxSEUaHpAynhT5y7L1lV2U2PiPUz/3DlpQSUD95pdb3t9JqpPXDQ10dpsl3SN+s1 hU2g== 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=5dvjwS2Am2yAFnga8rz27L3DBqKeoEPhmHVeWsdzwTA=; b=0WUdd6aOyzvkyhI0xEj0JDIO3sk9XTIPxN8k68F4O3njL7zipViYpPUckbYgA/TODX NpchDDPmcuW3NHoBdvrv0fi0juPKRr3yIRAdKJlBh3BkWunPxdY9G1QVJYvrB64d15VE ixiIFkANvZTaneFBI0OexiH9PSo2SHZ99EYWmW8DlRI+RJWzit1CMkmH/bo0IO2K7Dje 3WvgWDLQefarsc7r9fN1EV7nXbS/3ICQQeyCQUQGqx3f4Un3gs28CXFzva6tIRWRYOpq lcMvRC9sDKafAw7LsMyjO/A5FI4cF2W51xE5wH9FfFTzbGQZ2gt5z8aZLRysN9JisEiX /I7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Lz5/8FgO"; 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 g15-20020a056a001a0f00b00581e2a41c28si14814507pfv.307.2023.01.11.06.25.44; Wed, 11 Jan 2023 06:25: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="Lz5/8FgO"; 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 S239164AbjAKOZK (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238893AbjAKOYi (ORCPT ); Wed, 11 Jan 2023 09:24:38 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CB116486; Wed, 11 Jan 2023 06:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447077; x=1704983077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AWWr/BlbU8yzxpuWX74jI3h7EABvwrmH5cTRTGGc+aE=; b=Lz5/8FgOBH9QzC4RQdaTQ6+bsY9ZB/wYP21xweGcSydToDuJB+dli0cw n1U6r4GcyhcHxj9PXX9J37CIuRoT4YOVprrBVdBbcohehIeR6CspsyS6t 7SNz8dyKmFFHsLm/RaFZCxa/6firWpcEFCKrLbMfQR15r6LgvJW7cg3Qe AXwB3Jj2mGYt5yQtw8wgJojLW4tEoK///ujEZJbBbfI5pv9AKGnFCq+Qr QlFsdKO7JzAXHCC6hBfjoebP8/xaI6zZSqS+tT6rUVYR3v8QgVDzAeczO j7diP67g6uUc3sh4+1x2wdgQDUv5JheIFh/IZoTlInWoukjnHAfhsjUog g==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793658" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793658" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381982" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381982" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:33 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , "David S. Miller" , linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-usb@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 08/13] tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool active Date: Wed, 11 Jan 2023 16:23:26 +0200 Message-Id: <20230111142331.34518-9-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736527148947872?= X-GMAIL-MSGID: =?utf-8?q?1754736527148947872?= Convert status parameter for ->dcd_change() and uart_handle_dcd_change() to bool which matches to how the parameter is used. Rename status to active to better describe what the parameter means. Acked-by: Rodolfo Giometti Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- drivers/pps/clients/pps-ldisc.c | 6 +++--- drivers/tty/serial/serial_core.c | 8 ++++---- drivers/tty/serial/sunhv.c | 8 ++++---- drivers/usb/serial/generic.c | 10 +++++----- include/linux/serial_core.h | 3 +-- include/linux/tty_ldisc.h | 4 ++-- include/linux/usb/serial.h | 2 +- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c index d73c4c2ed4e1..443d6bae19d1 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 active) { struct pps_device *pps; struct pps_event_time ts; @@ -29,11 +29,11 @@ static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status) return; /* Now do the PPS event report */ - pps_event(pps, &ts, status ? PPS_CAPTUREASSERT : + pps_event(pps, &ts, active ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR, NULL); dev_dbg(pps->dev, "PPS %s at %lu\n", - status ? "assert" : "clear", jiffies); + active ? "assert" : "clear", jiffies); } static int (*alias_n_tty_open)(struct tty_struct *tty); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 053535846ba2..f8a9386db482 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3252,11 +3252,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 + * @active: new carrier detect status * * 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 active) { struct tty_port *port = &uport->state->port; struct tty_struct *tty = port->tty; @@ -3268,7 +3268,7 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) ld = tty_ldisc_ref(tty); if (ld) { if (ld->ops->dcd_change) - ld->ops->dcd_change(tty, status); + ld->ops->dcd_change(tty, active); tty_ldisc_deref(ld); } } @@ -3276,7 +3276,7 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) uport->icount.dcd++; if (uart_dcd_enabled(uport)) { - if (status) + if (active) wake_up_interruptible(&port->open_wait); else if (tty) tty_hangup(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..f2d31e56eafc 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -605,24 +605,24 @@ EXPORT_SYMBOL_GPL(usb_serial_handle_break); * usb_serial_handle_dcd_change - handle a change of carrier detect state * @port: usb-serial port * @tty: tty for the port - * @status: new carrier detect status, nonzero if active + * @active: new carrier-detect status */ void usb_serial_handle_dcd_change(struct usb_serial_port *port, - struct tty_struct *tty, unsigned int status) + struct tty_struct *tty, bool active) { - dev_dbg(&port->dev, "%s - status %d\n", __func__, status); + dev_dbg(&port->dev, "%s - active %d\n", __func__, active); if (tty) { struct tty_ldisc *ld = tty_ldisc_ref(tty); if (ld) { if (ld->ops->dcd_change) - ld->ops->dcd_change(tty, status); + ld->ops->dcd_change(tty, active); tty_ldisc_deref(ld); } } - if (status) + if (active) wake_up_interruptible(&port->port.open_wait); else if (tty && !C_CLOCAL(tty)) tty_hangup(tty); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index fd59f600094a..760c96ffb5bd 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 active); 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..49dc172dedc7 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 active)`` * * 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 active); 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..bad343c5e8a7 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 active); int usb_serial_bus_register(struct usb_serial_driver *device); From patchwork Wed Jan 11 14:23: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: 42034 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351379wrt; Wed, 11 Jan 2023 06:27:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXs101heR9S8VN0DS5CSD+MOPPz6cA6WATIQ9qzisSqLGTOjcq4otDnHaLWPQHnviOiLVYvj X-Received: by 2002:a05:6a20:9f85:b0:ac:16ae:f46 with SMTP id mm5-20020a056a209f8500b000ac16ae0f46mr90248617pzb.15.1673447228630; Wed, 11 Jan 2023 06:27:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447228; cv=none; d=google.com; s=arc-20160816; b=T+RbPCYmjj2wecLmEFdq7XIKKGIjImJxf0yCyMjv5hMr2xZjNTKxXbvt36yVGiYeXI XDpKNGHYes5N3X1vdQrG/ggz8ICY32HaUJDsxmSFIG/FSHckMPYwL8kRRl993psTGBEK qYbZksznkE2X8bDXNmqXsXMmE1fdkhO66MT14IROLCNGsxB5E8mIJq4YChayFxQgx/5c 5bOprf+583lCmpqYJfLMn5KMdQI3w6nsFgYp9cvZ+cinY4MSsctKyjt9SN0ZhSIQVFL+ SCevlIpRKKLZEL1J+NUuvrTJm441BMQSzSGtX+dZrB7Mb8U7ijfLM9XN2TvS3Tv6s6Ts 9gGA== 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=W+79fkbsEtqMhrw/EF9jteEKD5n6DAoi1fDXrZRxjlU=; b=ocTAx7m6htCmGU03WduuZolXSiDYMY/OCrH2MrlD9CFEULKpIpyRr2RrASoc82vDJB wlLFmFWdof4WOVTLckCPLowBNKbeC+RhjE09qvElXLaVhhwcAtPPRiQdQKPhEiWmA/2o F1qwHSHmdZ95qV79wXEz0KjwReH/8EVOpJ2L1qc/iR/U/MuehMw8IEsN0WuyV5e1Alcv N9qh2SBi0z571w231kZEM84K/GY3NI9E65EEP0bBiSnSEQu3GpvNkCXTbC6V0BEMb6hq TJUAAl5t+O8Mgsxesh83dZIYzwgQcd4M92ER1Qj9y0aBZucMzm7cl4+j4IClyYenEDpO X44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=US+MOOyc; 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 197-20020a6301ce000000b00478add2c2a6si14716421pgb.653.2023.01.11.06.26.55; Wed, 11 Jan 2023 06:27: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=US+MOOyc; 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 S239564AbjAKOZj (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239202AbjAKOYp (ORCPT ); Wed, 11 Jan 2023 09:24:45 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33D519C1F; Wed, 11 Jan 2023 06:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447084; x=1704983084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H7gcjHlQ0XUrWXxfntmwgVaPZ/M9meupAYikxPatJgg=; b=US+MOOycEPws8+Woif3vG8VFlaRMpaxplxLrxhlf6UPbdxzFUlIODHu1 Q+UNbzOKJ37KBtH/WgZygFbh2LSJJXfxdjDELECc/J5OsgPNrJZTfXigs CE2IlNXi4Y1uMohL60SuaaU4G7GPnNTzLTLOEdt5Lvt9+6tpQTwNd5qT3 lrkt3S04SbPAhJsF1hvmkJSITTgCiNuJvZ3a8LFE71+pGHMHA5ysbocyO XfsrWpZZ6gMjwt8YTP4+0gVLogQuk+Zs5ZQMnkq/xc3Igv8X5PjhWAhCE Y9ULihyC1dGi4wU+GKVEWGieAFSeRp2Zosi7HkHTJwCS2SfQadpOEUQ+i A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793706" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793706" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:43 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607381997" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607381997" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:38 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 09/13] serial: Make uart_handle_cts_change() status param bool active Date: Wed, 11 Jan 2023 16:23:27 +0200 Message-Id: <20230111142331.34518-10-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736601005831002?= X-GMAIL-MSGID: =?utf-8?q?1754736601005831002?= Convert uart_handle_cts_change() to bool which is more appropriate than unsigned int. Rename status to active to better describe what the parameter means. While at it, make the comment about the active parameter easier to parse. Cleanup callsites from operations that are not necessary with bool. Reviewed-by: Jiri Slaby 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 | 8 ++++---- include/linux/serial_core.h | 3 +-- 5 files changed, 8 insertions(+), 10 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 f8a9386db482..b8fff667d4f0 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3287,11 +3287,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 + * @active: new clear-to-send status * * 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 active) { lockdep_assert_held_once(&uport->lock); @@ -3299,13 +3299,13 @@ void uart_handle_cts_change(struct uart_port *uport, unsigned int status) if (uart_softcts_mode(uport)) { if (uport->hw_stopped) { - if (status) { + if (active) { uport->hw_stopped = 0; uport->ops->start_tx(uport); uart_write_wakeup(uport); } } else { - if (!status) { + if (!active) { uport->hw_stopped = 1; uport->ops->stop_tx(uport); } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 760c96ffb5bd..ddd7c9425938 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 active); -extern void uart_handle_cts_change(struct uart_port *uport, - unsigned int status); +extern void uart_handle_cts_change(struct uart_port *uport, bool active); 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 11 14:23: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: 42030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351008wrt; Wed, 11 Jan 2023 06:26:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSHY7wmHP+2dlLttbE3MBbV5/ZEnG6R9Wauk64THZpK5KZjPVAji1MCafJgQK4nwVPAI1B X-Received: by 2002:a17:902:f7d2:b0:192:6a00:5d08 with SMTP id h18-20020a170902f7d200b001926a005d08mr55651874plw.48.1673447181219; Wed, 11 Jan 2023 06:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447181; cv=none; d=google.com; s=arc-20160816; b=LRwyFiFgELy+V2I9SwWVrGz8DDsPm/vQZE0iixB8k9SuYyMRqEA0bnlA03RjRB9RKv ayCXgQGtDwiVorpMxlAgkc8dGfRFydNhZSGnuZt5gYmyNzRIOaMgGW+lBnUfB59u3eNr Zgf/yYXySiaxYbEWjGch4u2RieA8wkO3nGbUTZ4iKte/p4skM6+PF2BBwJ4vREGofcon maC72t4yquFS1SLXBQjTCXE7gtRbXbEyNpBSChYbc6UaKxkgNlM2PMhxcFSqsuiQiIG9 QYi7TF3aQ9NWxfPmRUA+6HgNyr2KklQopUnAhkIwfkNK/qGe+p/pRrRr7HiaXv+EYyNa c4bA== 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=ZUj1GwEC/dB1rJ/788CFBLlTPDgjHs4MSyXtklJOPcc=; b=cPke9E7g9UYAlmsVXGjVSn4sk/FnmNQHPqktucFdb5f1gqqqdmZB6rcMr0XztXi+zf guCuVCH1g52uLbtHh0Oywrshm9sYJEUcng43GCFUgSPdgtwYuEf1D+oGMYiGosG+Tim6 o/4G14fsOCHExaivtxJm+ECKBvi9m+KwLl7kxfMkdqAn5vmLcLbnSons8OyIfxycAaR0 xNJXQi5t4Ym+agoOERPu6i6QhF3ePBIYSDXncBGd0WXElM7ajXCVtrF62aBkFeAgpNxp xmAzK1qGyqfB8N5r6bNwundOAIsJ6pTW0G+nJIQv8DPRjTCX+PxzefoP7YHEN5bJreuG yPow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C9nw4RuG; 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 u1-20020a170902a60100b0018fa4f831e3si13658215plq.357.2023.01.11.06.26.08; Wed, 11 Jan 2023 06:26: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=C9nw4RuG; 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 S239546AbjAKOZb (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239286AbjAKOYt (ORCPT ); Wed, 11 Jan 2023 09:24:49 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A16C618693; Wed, 11 Jan 2023 06:24: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=1673447087; x=1704983087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BA6+VzTrzXJU5RNlgIhIBoCQlD0/oKxFAfCpVwMo5lA=; b=C9nw4RuG3PVcw+NWX/LCqUboT8RcxNgThl0/Jftws5uI61f8c8VZt/Y/ VsNZxKazVBovFsEX8IyRubL/dbtgW18VFF9B66mrE4oj4+j8y8Tt7t0UX t6h75ayGTGI8NKZ4DZf+fNfRDaR+cvrgoRnZ9WCMHyaqQpLFYAjfw1/mH +g7gvTS3a+WcOo2O6C6Cg2X3Vk3PAqqgmrnpEqsoXVcC7SSnr+Zzf0Fpe /DOHPkYZug6RJSWkG1E2boqMOmnAaM4CCPORtoGttgGeRc/UoXFOBWHKE w5dZyXehcetejJ/ATLFjWG94afwQAZ9KDJXzeHqf4owfMNy96QMeGQKnA w==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793731" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793731" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607382037" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607382037" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:43 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 10/13] tty: Return bool from tty_termios_hw_change() Date: Wed, 11 Jan 2023 16:23:28 +0200 Message-Id: <20230111142331.34518-11-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736551334229711?= X-GMAIL-MSGID: =?utf-8?q?1754736551334229711?= Change tty_termios_hw_change() to return bool. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Reviewed-by: Johan Hovold --- drivers/tty/tty_ioctl.c | 8 ++++---- include/linux/tty.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index ce511557b98b..12983ce4e43e 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -270,13 +270,13 @@ 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; + return true; if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL)) - return 1; - return 0; + return true; + return false; } 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); From patchwork Wed Jan 11 14:23: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: 42036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351451wrt; Wed, 11 Jan 2023 06:27:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXt00Vn+sRnPa7bXoumhRj1nzwHiRLJqHsUluQdXWzdU9+3wbCEvkSMWrGrnzyF3dcpEKD2p X-Received: by 2002:a17:90b:2684:b0:227:203d:4d70 with SMTP id pl4-20020a17090b268400b00227203d4d70mr9965168pjb.32.1673447239353; Wed, 11 Jan 2023 06:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447239; cv=none; d=google.com; s=arc-20160816; b=PXaHb4tb9xzmusz3BkEyBPwyd5TJ5uD+uYdzVIhuvIsRxcw93QZ4GyknXOgDr1CMPC u/iVXJVprJs2xtrumhjtTmHFv97hokRe0aDw0+5gxnUJPB/UK8m1rOpYyxZRQw4p2L+e ATUrweIJV9PnD9pleYK3q7jl1MeO/4ZOvxa6jmzi4am6TT/YdaqPV9gU1ND2Wl8aSQzC KPvmiiHO2XVHg0HJMbHihgga5pJPoE8JXUa1243UHmowgsVat4aY69bsqK9XUVL9oVjU 7gFTPu+LqwY1wA6lpK97P59wbe2uGm08A/AgZJkVqv1HEFqS13+RLlSpKME8O6d6Ojob 97bg== 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=wGXbOTxlUfcapvOPdpvMU10XsOuUe1N926N5wilArXI=; b=YaMdO7peV9RHI8inP6UVWeMKCgg85AcuKPw2p3j4Xo9M58Qng+0ITObcCTk7dBv1dr 5paHdv/wnkBwdZqd6mh1mUNHSVNUBhZCYCP7RfsgBu2dMF4OellyjWYOcfo3Csy1BqxD TAmdQRWr39qeMJuubAejbJ0KXaBCU5Ej7LF1vubroXdEXGWkE9ZGplfkhH0GO5XZeTef iZWeqH/2bV1lyXvIBfXzmCfE+mPq/WkWlmSAsnFi3+vMzzaKCWBNOnsrzFF05anx3Y8P SgQO0YPj6BjRkDKJ4K8WSS6wYSiaMMV1ElQcOzTn06LFiZu39NhZgTD8dWml8yT9rG8g 92tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Yo/5oF9R"; 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 w18-20020a17090a8a1200b002262dd7f57fsi17328759pjn.75.2023.01.11.06.27.06; Wed, 11 Jan 2023 06:27:19 -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="Yo/5oF9R"; 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 S239385AbjAKOZs (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239357AbjAKOY5 (ORCPT ); Wed, 11 Jan 2023 09:24:57 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1321A238; Wed, 11 Jan 2023 06:24: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=1673447096; x=1704983096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PRO9D6FhTscnYzI0vbvYF4k5EJgW6UJDcQwdeuhGuNE=; b=Yo/5oF9RG5GYkJ+Dw45drSNYmqFNh3B7JmHSxvbg6Bkb6OMbGbOCfujU g9CKZDMwgsfIEsNnUOQBXW++i/BbOZUkICKgxqC/s7ZfyvAVbvyDSJFKN w5CgMocLFqw3jWj/nTrzwddGDdUELvxSHOxrwEBRWvBEKY3DgfhJt5nnw a1MZYNvXshfoHxVrUP5slk/B6dXXI4rnzZhqxNq7dAiKS9Io2bjcgibPW 3dZ6DSCtzJwfDRd1xMj2atmxSF9aqARN7oHUzHCBBPQ+lMB0TI4z9UgsU K8Ks66M5FIp8FK/6LDg6FuF0sR3Y0kRCq1OTY0tttZI4H6tGXtkAuoHr5 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793762" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793762" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:55 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607382066" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607382066" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:47 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Arnd Bergmann , Ulf Hansson , David Lin , Alex Elder , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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 v3 11/13] tty/serial: Call ->dtr_rts() parameter active consistently Date: Wed, 11 Jan 2023 16:23:29 +0200 Message-Id: <20230111142331.34518-12-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736612589425861?= X-GMAIL-MSGID: =?utf-8?q?1754736612589425861?= Convert various parameter names for ->dtr_rts() and related functions from onoff, on, and raise to active. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen Acked-by: Ulf Hansson # For MMC --- drivers/char/pcmcia/synclink_cs.c | 6 +++--- drivers/mmc/core/sdio_uart.c | 6 +++--- drivers/staging/greybus/uart.c | 4 ++-- drivers/tty/amiserial.c | 4 ++-- drivers/tty/hvc/hvc_console.h | 2 +- drivers/tty/hvc/hvc_iucv.c | 6 +++--- drivers/tty/mxser.c | 4 ++-- drivers/tty/n_gsm.c | 4 ++-- drivers/tty/serial/serial_core.c | 8 ++++---- drivers/tty/synclink_gt.c | 4 ++-- include/linux/tty_port.h | 4 ++-- include/linux/usb/serial.h | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 46a0b586d234..1577eba6fe0e 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, bool onoff); +static void dtr_rts(struct tty_port *port, bool active); #if SYNCLINK_GENERIC_HDLC #define dev_to_port(D) (dev_to_hdlc(D)->priv) @@ -2442,13 +2442,13 @@ static bool carrier_raised(struct tty_port *port) return info->serial_signals & SerialSignal_DCD; } -static void dtr_rts(struct tty_port *port, bool onoff) +static void dtr_rts(struct tty_port *port, bool active) { MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port); unsigned long flags; spin_lock_irqsave(&info->lock, flags); - if (onoff) + if (active) info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; else info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c index c6b4b2b2a4b2..50536fe59f1a 100644 --- a/drivers/mmc/core/sdio_uart.c +++ b/drivers/mmc/core/sdio_uart.c @@ -542,20 +542,20 @@ static bool uart_carrier_raised(struct tty_port *tport) /** * uart_dtr_rts - port helper to set uart signals * @tport: tty port to be updated - * @onoff: set to turn on DTR/RTS + * @active: set to turn on DTR/RTS * * Called by the tty port helpers when the modem signals need to be * adjusted during an open, close and hangup. */ -static void uart_dtr_rts(struct tty_port *tport, bool onoff) +static void uart_dtr_rts(struct tty_port *tport, bool active) { 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) + if (!active) 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 92d49740d5a4..20a34599859f 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, bool on) +static void gb_tty_dtr_rts(struct tty_port *port, bool active) { struct gb_tty *gb_tty; u8 newctrl; @@ -709,7 +709,7 @@ static void gb_tty_dtr_rts(struct tty_port *port, bool on) gb_tty = container_of(port, struct gb_tty, port); newctrl = gb_tty->ctrlout; - if (on) + if (active) newctrl |= (GB_UART_CTRL_DTR | GB_UART_CTRL_RTS); else newctrl &= ~(GB_UART_CTRL_DTR | GB_UART_CTRL_RTS); diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 29d4c554f6b8..d7515d61659e 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1459,13 +1459,13 @@ static bool amiga_carrier_raised(struct tty_port *port) return !(ciab.pra & SER_DCD); } -static void amiga_dtr_rts(struct tty_port *port, bool raise) +static void amiga_dtr_rts(struct tty_port *port, bool active) { struct serial_state *info = container_of(port, struct serial_state, tport); unsigned long flags; - if (raise) + if (active) info->MCR |= SER_DTR|SER_RTS; else info->MCR &= ~(SER_DTR|SER_RTS); diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 6d3428bf868f..9668f821db01 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, bool raise); + void (*dtr_rts)(struct hvc_struct *hp, bool active); }; /* 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 fe862a6882d6..543f35ddf523 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: True to raise or false to lower DTR/RTS lines + * @active: 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, bool raise) +static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool active) { struct hvc_iucv_private *priv; struct iucv_path *path; @@ -672,7 +672,7 @@ static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise) /* Raising the DTR/RTS is ignored as IUCV connections can be * established at any times. */ - if (raise) + if (active) return; priv = hvc_iucv_get_private(hp->vtermno); diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index d4fb11e39bb1..ef3116e87975 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, bool on) +static void mxser_dtr_rts(struct tty_port *port, bool active) { struct mxser_port *mp = container_of(port, struct mxser_port, port); unsigned long flags; @@ -473,7 +473,7 @@ static void mxser_dtr_rts(struct tty_port *port, bool on) spin_lock_irqsave(&mp->slock, flags); mcr = inb(mp->ioaddr + UART_MCR); - if (on) + if (active) mcr |= UART_MCR_DTR | UART_MCR_RTS; else mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 8dd0d6441c42..4f29b00f2645 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3792,11 +3792,11 @@ static bool gsm_carrier_raised(struct tty_port *port) return dlci->modem_rx & TIOCM_CD; } -static void gsm_dtr_rts(struct tty_port *port, bool onoff) +static void gsm_dtr_rts(struct tty_port *port, bool active) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); unsigned int modem_tx = dlci->modem_tx; - if (onoff) + if (active) modem_tx |= TIOCM_DTR | TIOCM_RTS; else modem_tx &= ~(TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index b8fff667d4f0..da4e4e8a2b50 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -169,9 +169,9 @@ 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, bool raise) +static void uart_port_dtr_rts(struct uart_port *uport, bool active) { - if (raise) + if (active) uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); else uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); @@ -1885,7 +1885,7 @@ static bool uart_carrier_raised(struct tty_port *port) return mctrl & TIOCM_CAR; } -static void uart_dtr_rts(struct tty_port *port, bool raise) +static void uart_dtr_rts(struct tty_port *port, bool active) { struct uart_state *state = container_of(port, struct uart_state, port); struct uart_port *uport; @@ -1893,7 +1893,7 @@ static void uart_dtr_rts(struct tty_port *port, bool raise) uport = uart_port_ref(state); if (!uport) return; - uart_port_dtr_rts(uport, raise); + uart_port_dtr_rts(uport, active); uart_port_deref(uport); } diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 2b786265ce7b..33f258d6fef9 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3138,13 +3138,13 @@ static bool carrier_raised(struct tty_port *port) return info->signals & SerialSignal_DCD; } -static void dtr_rts(struct tty_port *port, bool on) +static void dtr_rts(struct tty_port *port, bool active) { unsigned long flags; struct slgt_info *info = container_of(port, struct slgt_info, port); spin_lock_irqsave(&info->lock,flags); - if (on) + if (active) info->signals |= SerialSignal_RTS | SerialSignal_DTR; else info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); diff --git a/include/linux/tty_port.h b/include/linux/tty_port.h index c44e489de0ff..edf685a24f7c 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 true, otherwise lower DTR + * @dtr_rts: raise the DTR line if @active 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, bool raise); + void (*dtr_rts)(struct tty_port *port, bool active); 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 bad343c5e8a7..33afd9f3ebbe 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, bool on); + void (*dtr_rts)(struct usb_serial_port *port, bool active); 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 11 14:23: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: 42032 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351359wrt; Wed, 11 Jan 2023 06:27:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXs0b72rZO2dMy5kBYDZY+RBXE1v4veJ8OjjMC1QyXRw4C0F8GpQ4bOlkO3MGPW30g1/6NPv X-Received: by 2002:a17:906:4c8a:b0:84d:3a95:cdf9 with SMTP id q10-20020a1709064c8a00b0084d3a95cdf9mr10515633eju.50.1673447226902; Wed, 11 Jan 2023 06:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447226; cv=none; d=google.com; s=arc-20160816; b=oF6vB19uwHFc6ftM1ewaVMlSJzRYoLvwclGH5xbOigroxlRR72hYHomESXw9T0jIFo 36S/LGyw2IwdX7aLbWGXIWZ1wUEjKkwyjHVmCdrNLxzhxYD4asPK7jObljXU9p3+wqPk 0PEzptJ0yW6/rqikwsbodAfik+Zd9KSnzK6DnFvXgCWklPlwTWud09cgBgX5+IBwsbLU MP9CtPxohxZJHWLBvZ5fgSW5+Wz5PWe6vcfl+GNDt3hRiFyd3wMxWOLhZTMQzo/AJyhz w6rCMK0cOPboxaTfa2E9dLNIofIGt48vZwdIfF5v1LE9z8xuaWiHVFqNmUhfv4sN3qxR P1Zg== 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=r0CRBgYgZpWryKUYW9G1i/y7g20G23LNXVWdXIyIeuE=; b=m53VdAPUyGjgjgVfMWan5sqtiQ4tahxUFaZQdas3VOTlu82qul4ueqXqSDa7R2dDWb mWiykz8Tpe85y2eStye0jYd4Ws/DQhtHD9rrXWuJ4sQfwppTa0ga8NCSpc/E4HnEwH+f V2A4AGjJ42Sfuntcl9Uqh+6kUO9rGaSIZxQZgC2Ms60Q4+NadYOQ1nrYEtknLoy4Egux ffvrsM+ZPN13VdEC0H3BrGXBESSiMQAVkbYXyxU0M0bEY6zC6bgShfQUmfDmXnpcYI9/ 6Y8cwsBDXIulqCr6Bx2yuzZS/blbVP+29wWmSW7wTbLLEJqCzehO0xXJmhjoT8gmyFWv jw5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a+oRc5Va; 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 hc37-20020a17090716a500b007808f3f4cbcsi16857144ejc.239.2023.01.11.06.26.40; Wed, 11 Jan 2023 06:27:06 -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=a+oRc5Va; 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 S239622AbjAKOZz (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239364AbjAKOZA (ORCPT ); Wed, 11 Jan 2023 09:25:00 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4921E5F44; Wed, 11 Jan 2023 06:24: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=1673447099; x=1704983099; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=azs8MhAXaT8ciQ/+X9QDrSPGZ0tpeX4mV+5vi33IK0c=; b=a+oRc5VazYi5a98TMWzjIneynLMgh7eJdRPstXuW4i3hvdb88RLqlLS6 WUjXwWgCV0tA/wDwzMRICIvUosMNh4dBzE1SXSjFYMdDKzCmnGYakTOAl 3m7r2ZmfATG8EE7wqAFs0BXs8PXnM1Mcl7p06Fle510B6HaLtB3wJ9pPY oclbgqqhq3fon1JRMDeO4QvSSC14X1CocZwT9jveLT1jcaOlz6SSwJCpS CHkaJ6QSZYb7yFzFTAA/Z7oZtdg8Gck7/2pyAcs606aPZwlCeHD3bttWw erwgA6jDUm9zy+CS/zIltqFK/Qxkm36wTwiXQK2ou+VokhywjjwccFe2x A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793796" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793796" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607382106" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607382106" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:24:55 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 12/13] tty: moxa: Rename dtr/rts parameters/variables to active Date: Wed, 11 Jan 2023 16:23:30 +0200 Message-Id: <20230111142331.34518-13-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736599616895902?= X-GMAIL-MSGID: =?utf-8?q?1754736599616895902?= Use active consistently for naming parameters and variables. Reviewed-by: Jiri Slaby Signed-off-by: Ilpo Järvinen --- drivers/tty/moxa.c | 52 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 9be3d585d5a9..42fa4c878b2e 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1443,10 +1443,10 @@ static bool moxa_carrier_raised(struct tty_port *port) return dcd; } -static void moxa_dtr_rts(struct tty_port *port, bool onoff) +static void moxa_dtr_rts(struct tty_port *port, bool active) { struct moxa_port *ch = container_of(port, struct moxa_port, port); - MoxaPortLineCtrl(ch, onoff, onoff); + MoxaPortLineCtrl(ch, active, active); } @@ -1557,14 +1557,14 @@ static unsigned int moxa_chars_in_buffer(struct tty_struct *tty) static int moxa_tiocmget(struct tty_struct *tty) { struct moxa_port *ch = tty->driver_data; - bool dtr, rts; + bool dtr_active, rts_active; int flag = 0; int status; - MoxaPortGetLineOut(ch, &dtr, &rts); - if (dtr) + MoxaPortGetLineOut(ch, &dtr_active, &rts_active); + if (dtr_active) flag |= TIOCM_DTR; - if (rts) + if (rts_active) flag |= TIOCM_RTS; status = MoxaPortLineStatus(ch); if (status & 1) @@ -1579,8 +1579,8 @@ static int moxa_tiocmget(struct tty_struct *tty) static int moxa_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) { + bool dtr_active, rts_active; struct moxa_port *ch; - bool dtr, rts; mutex_lock(&moxa_openlock); ch = tty->driver_data; @@ -1589,16 +1589,16 @@ static int moxa_tiocmset(struct tty_struct *tty, return -EINVAL; } - MoxaPortGetLineOut(ch, &dtr, &rts); + MoxaPortGetLineOut(ch, &dtr_active, &rts_active); if (set & TIOCM_RTS) - rts = true; + rts_active = true; if (set & TIOCM_DTR) - dtr = true; + dtr_active = true; if (clear & TIOCM_RTS) - rts = false; + rts_active = false; if (clear & TIOCM_DTR) - dtr = false; - MoxaPortLineCtrl(ch, dtr, rts); + dtr_active = false; + MoxaPortLineCtrl(ch, dtr_active, rts_active); mutex_unlock(&moxa_openlock); return 0; } @@ -1881,10 +1881,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * Syntax: * int MoxaPortGetLineOut(int port, bool *dtrState, bool *rtsState); * int port : port number (0 - 127) - * bool * dtrState : pointer to bool to receive the current DTR + * bool * dtr_active : pointer to bool to receive the current DTR * state. (if NULL, this function will not * write to this address) - * bool * rtsState : pointer to bool to receive the current RTS + * bool * rts_active : pointer to bool to receive the current RTS * state. (if NULL, this function will not * write to this address) * @@ -1896,8 +1896,8 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * Syntax: * void MoxaPortLineCtrl(int port, bool dtrState, bool rtsState); * int port : port number (0 - 127) - * bool dtrState : DTR output state - * bool rtsState : RTS output state + * bool dtr_active : DTR output state + * bool rts_active : RTS output state * * * Function 15: Setting the flow control of this port. @@ -2105,24 +2105,24 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio, return baud; } -static int MoxaPortGetLineOut(struct moxa_port *port, bool *dtrState, - bool *rtsState) +static int MoxaPortGetLineOut(struct moxa_port *port, bool *dtr_active, + bool *rts_active) { - if (dtrState) - *dtrState = port->lineCtrl & DTR_ON; - if (rtsState) - *rtsState = port->lineCtrl & RTS_ON; + if (dtr_active) + *dtr_active = port->lineCtrl & DTR_ON; + if (rts_active) + *rts_active = port->lineCtrl & RTS_ON; return 0; } -static void MoxaPortLineCtrl(struct moxa_port *port, bool dtr, bool rts) +static void MoxaPortLineCtrl(struct moxa_port *port, bool dtr_active, bool rts_active) { u8 mode = 0; - if (dtr) + if (dtr_active) mode |= DTR_ON; - if (rts) + if (rts_active) mode |= RTS_ON; port->lineCtrl = mode; moxafunc(port->tableAddr, FC_LineControl, mode); From patchwork Wed Jan 11 14:23: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: 42033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3351368wrt; Wed, 11 Jan 2023 06:27:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/vQVjWWDaQ2UmKVP2jrNDBQOOZQkwtAbelGUPDPgwEBz6CsFvQIc2n+GWpS2/fPBtG+1e X-Received: by 2002:a05:6a20:4287:b0:b6:4270:6dfc with SMTP id o7-20020a056a20428700b000b642706dfcmr3990354pzj.6.1673447227891; Wed, 11 Jan 2023 06:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673447227; cv=none; d=google.com; s=arc-20160816; b=SjzEaOG0kSyTCznADBLRTyTSRZiPbzxSzCGxstjccQqLe3hiVQLKY8t0P+ztcph1A3 VKyhUIrGXjf4NZgA59lXNWSwoE+/3IgKNY7xGPZIg+74EhkdiPN4H7BwO6jSkVk/FGuW Sgt/oRqVuUjjgyY2yiqxNK66amANubPJHP6aIkKN/GDPRoXvSCEIfADTjtwLTqzZTvEM /iCFBCaK+ShUR5EdFF7fFAGJdGf0AzJcENJc+ZF0vxv+95oMiIqwJ8ZVpfz2Ecunh95a lYdv1h9g3Fe6TfY8ANcEGcm5Je6sWPF/tRT7UJueybF7klsEwASiPH9fCeFjA/DmHny2 kBbg== 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=R5PsBWA9kU1pH8NMHFD5Wgnkr9NEkbpTUt6S4tHnD/I=; b=zKPg7yGng6vj/vhQMHwcJFjZG9d51eaCpUvMtpB4RREGFqeSsjGf1ZSxnBuDYhmQcO IA5P55NO4raOQ+r/Yb+zq9I75ZY7yB4WOmYaI0lUmFlMXRgni2576CZBirKCW/TnDEkV fhZMyk1YhjgrgQHEIOnNJt1jY6ZlxrqtHEsj0ppkKqNfjP5qG7Ulit1LqzWh5P0preZz tBQlTeSxKLKf7L9AE3R09RCCIUl8cpdpjWxr5q2eqzd8SEeSnNxWiwLDdAuPpD5JPM1b 3IKlSvmXOJAssk4f4kAlwtAojcb+L9WWyvlzKi0XyY9Elp++Pd3VwAb/ViUO9EqZlLbF fNzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jiPcjGW7; 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 c5-20020a6566c5000000b00499ded12ff1si15161842pgw.245.2023.01.11.06.26.54; Wed, 11 Jan 2023 06:27:07 -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=jiPcjGW7; 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 S239610AbjAKOZw (ORCPT + 99 others); Wed, 11 Jan 2023 09:25:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239455AbjAKOZG (ORCPT ); Wed, 11 Jan 2023 09:25:06 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462EC13F03; Wed, 11 Jan 2023 06:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447105; x=1704983105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Tjo30vecdnfzzkp73XHKlN6YohIR8095ki6mZ5URrJY=; b=jiPcjGW7rimBOzrpC6OLvtNpJDjcQtMSjqOG8WVnp4OIgZ/LP7Cd7oVt dxlte4CqsMzTXrlwKKExsO/KnFyG4Gzko/QrAgEc28H5CI+OLsmTpAI6V lZWMhvjAuKVUVdKqIcAmYz6NNBw2SHg3sivi4WlHt1PBQH0zu+Ehxuxlk 8Wv2WmTOa2puX4L+78lUBQLrThnqi43kywyx3kVzFgQiGEDiMM3U62E+9 t7odK5qGthKH6tjsCzAGN6U3vUslfWWTzHMpbjMpz4orV2y7pz6d7rHNA oNTQao8OcMJXYcMJSUJ9Jji0P2NynE67xgjIvJdYznUIpLhUMZbkHyZ2U A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303793840" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303793840" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:25:04 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="607382161" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="607382161" Received: from mihaiana-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.222.62]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:25:00 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , =?utf-8?q?Samuel_Iglesias_Gons=C3=A1lvez?= , Rodolfo Giometti , Oliver Neukum , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 13/13] usb/serial: Rename dtr/rts parameters/variables to active Date: Wed, 11 Jan 2023 16:23:31 +0200 Message-Id: <20230111142331.34518-14-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111142331.34518-1-ilpo.jarvinen@linux.intel.com> References: <20230111142331.34518-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_NONE, 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?1754736600381671609?= X-GMAIL-MSGID: =?utf-8?q?1754736600381671609?= Use active consistently for naming parameters and variables. This converts all USB serial drivers + CDC-ACM. Signed-off-by: Ilpo Järvinen --- drivers/usb/class/cdc-acm.c | 4 ++-- drivers/usb/serial/ch341.c | 4 ++-- drivers/usb/serial/cp210x.c | 6 +++--- drivers/usb/serial/cypress_m8.c | 6 +++--- drivers/usb/serial/digi_acceleport.c | 6 +++--- drivers/usb/serial/f81232.c | 4 ++-- drivers/usb/serial/f81534.c | 4 ++-- drivers/usb/serial/ftdi_sio.c | 6 +++--- drivers/usb/serial/ipw.c | 8 ++++---- drivers/usb/serial/keyspan.c | 6 +++--- drivers/usb/serial/keyspan_pda.c | 4 ++-- drivers/usb/serial/mct_u232.c | 6 +++--- drivers/usb/serial/mxuport.c | 4 ++-- drivers/usb/serial/pl2303.c | 4 ++-- drivers/usb/serial/quatech2.c | 6 +++--- drivers/usb/serial/sierra.c | 6 +++--- drivers/usb/serial/spcp8x5.c | 4 ++-- drivers/usb/serial/ssu100.c | 6 +++--- drivers/usb/serial/upd78f0730.c | 4 ++-- drivers/usb/serial/usb-serial.c | 4 ++-- drivers/usb/serial/usb-wwan.h | 2 +- drivers/usb/serial/usb_wwan.c | 6 +++--- drivers/usb/serial/xr_serial.c | 4 ++-- 23 files changed, 57 insertions(+), 57 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index d4f9220b8162..11da5fb284d0 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -651,13 +651,13 @@ 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, bool raise) +static void acm_port_dtr_rts(struct tty_port *port, bool active) { struct acm *acm = container_of(port, struct acm, port); int val; int res; - if (raise) + if (active) val = USB_CDC_CTRL_DTR | USB_CDC_CTRL_RTS; else val = 0; diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 98ec4fe46914..68e2eddde911 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -420,14 +420,14 @@ 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, bool on) +static void ch341_dtr_rts(struct usb_serial_port *port, bool active) { struct ch341_private *priv = usb_get_serial_port_data(port); unsigned long flags; /* drop DTR and RTS */ spin_lock_irqsave(&priv->lock, flags); - if (on) + if (active) priv->mcr |= CH341_BIT_RTS | CH341_BIT_DTR; else priv->mcr &= ~(CH341_BIT_RTS | CH341_BIT_DTR); diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index fe2cdc477fb9..c5c80492ad98 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, bool on); +static void cp210x_dtr_rts(struct usb_serial_port *port, bool active); 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,9 +1402,9 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, return ret; } -static void cp210x_dtr_rts(struct usb_serial_port *port, bool on) +static void cp210x_dtr_rts(struct usb_serial_port *port, bool active) { - if (on) + if (active) cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0); else cp210x_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 7c6060c17ee0..5167cf6dd99c 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, bool on); +static void cypress_dtr_rts(struct usb_serial_port *port, bool active); 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, bool on) +static void cypress_dtr_rts(struct usb_serial_port *port, bool active) { struct cypress_private *priv = usb_get_serial_port_data(port); /* drop dtr and rts */ spin_lock_irq(&priv->lock); - if (!on) + if (!active) 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 890e446273d7..82529c1939ca 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, bool on); +static void digi_dtr_rts(struct usb_serial_port *port, bool active); 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, bool on) +static void digi_dtr_rts(struct usb_serial_port *port, bool active) { /* Adjust DTR and RTS */ - digi_set_modem_signals(port, on ? (TIOCM_DTR | TIOCM_RTS) : 0, 1); + digi_set_modem_signals(port, active ? (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 1656be847460..ca5ff47417a9 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -752,9 +752,9 @@ 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, bool on) +static void f81232_dtr_rts(struct usb_serial_port *port, bool active) { - if (on) + if (active) f81232_set_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0); else f81232_set_mctrl(port, 0, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index 8b44b08752d6..1c3de4c752d6 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f81534.c @@ -1456,9 +1456,9 @@ 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, bool on) +static void f81534_dtr_rts(struct usb_serial_port *port, bool active) { - if (on) + if (active) f81534_update_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0); else f81534_update_mctrl(port, 0, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 09bdf623e94e..002db8bc6a16 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2366,12 +2366,12 @@ 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, bool on) +static void ftdi_dtr_rts(struct usb_serial_port *port, bool active) { struct ftdi_private *priv = usb_get_serial_port_data(port); /* Disable flow control */ - if (!on) { + if (!active) { if (usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0), FTDI_SIO_SET_FLOW_CTRL_REQUEST, @@ -2382,7 +2382,7 @@ static void ftdi_dtr_rts(struct usb_serial_port *port, bool on) } } /* drop RTS and DTR */ - if (on) + if (active) set_mctrl(port, TIOCM_DTR | TIOCM_RTS); else clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index b1b7a033cc75..1937e4dfe2d9 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -215,18 +215,18 @@ static void ipw_release(struct usb_serial *serial) kfree(data); } -static void ipw_dtr_rts(struct usb_serial_port *port, bool on) +static void ipw_dtr_rts(struct usb_serial_port *port, bool active) { struct usb_device *udev = port->serial->dev; struct device *dev = &port->dev; int result; - dev_dbg(dev, "%s: on = %d\n", __func__, on); + dev_dbg(dev, "%s: active = %d\n", __func__, active); result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), IPW_SIO_SET_PIN, USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, - on ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR, + active ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR, 0, NULL, 0, @@ -237,7 +237,7 @@ static void ipw_dtr_rts(struct usb_serial_port *port, bool on) result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), IPW_SIO_SET_PIN, USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, - on ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS, + active ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS, 0, NULL, 0, diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 7e375367354b..241d7179d421 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -1564,12 +1564,12 @@ 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, bool on) +static void keyspan_dtr_rts(struct usb_serial_port *port, bool active) { struct keyspan_port_private *p_priv = usb_get_serial_port_data(port); - p_priv->rts_state = on; - p_priv->dtr_state = on; + p_priv->rts_state = active; + p_priv->dtr_state = active; keyspan_send_setup(port, 0); } diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index cb16c4bc8555..4a2e66c771fb 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -551,11 +551,11 @@ 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, bool on) +static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool active) { struct usb_serial *serial = port->serial; - if (on) + if (active) keyspan_pda_set_modem_info(serial, BIT(7) | BIT(2)); else keyspan_pda_set_modem_info(serial, 0); diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index eb3520490dd2..d871b7cbc550 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, bool on); +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool active); 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,13 +477,13 @@ 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, bool on) +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool active) { unsigned int control_state; struct mct_u232_private *priv = usb_get_serial_port_data(port); spin_lock_irq(&priv->lock); - if (on) + if (active) priv->control_state |= TIOCM_DTR | TIOCM_RTS; else priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c index ac7594635719..da7c40db64c8 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, bool on) +static void mxuport_dtr_rts(struct usb_serial_port *port, bool active) { struct mxuport_port *mxport = usb_get_serial_port_data(port); u8 mcr_state; @@ -683,7 +683,7 @@ static void mxuport_dtr_rts(struct usb_serial_port *port, bool on) mutex_lock(&mxport->mutex); mcr_state = mxport->mcr_state; - if (on) + if (active) mcr_state |= (UART_MCR_RTS | UART_MCR_DTR); else mcr_state &= ~(UART_MCR_RTS | UART_MCR_DTR); diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index cb20911f35bb..da23412e6a54 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -931,14 +931,14 @@ static void pl2303_set_termios(struct tty_struct *tty, kfree(buf); } -static void pl2303_dtr_rts(struct usb_serial_port *port, bool on) +static void pl2303_dtr_rts(struct usb_serial_port *port, bool active) { struct pl2303_private *priv = usb_get_serial_port_data(port); unsigned long flags; u8 control; spin_lock_irqsave(&priv->lock, flags); - if (on) + if (active) priv->line_control |= (CONTROL_DTR | CONTROL_RTS); else priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 6fd329ffec7e..7e513c6106b5 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -770,19 +770,19 @@ static void qt2_break_ctl(struct tty_struct *tty, int break_state) -static void qt2_dtr_rts(struct usb_serial_port *port, bool on) +static void qt2_dtr_rts(struct usb_serial_port *port, bool active) { struct usb_device *dev = port->serial->dev; struct qt2_port_private *port_priv = usb_get_serial_port_data(port); /* Disable flow control */ - if (!on) { + if (!active) { if (qt2_setregister(dev, port_priv->device_port, UART_MCR, 0) < 0) dev_warn(&port->dev, "error from flowcontrol urb\n"); } /* drop RTS and DTR */ - if (on) + if (active) update_mctrl(port_priv, TIOCM_DTR | TIOCM_RTS, 0); else update_mctrl(port_priv, 0, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index f2c3a7af1a4a..ed941acc49be 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -813,13 +813,13 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) } -static void sierra_dtr_rts(struct usb_serial_port *port, bool on) +static void sierra_dtr_rts(struct usb_serial_port *port, bool active) { struct sierra_port_private *portdata; portdata = usb_get_serial_port_data(port); - portdata->rts_state = on; - portdata->dtr_state = on; + portdata->rts_state = active; + portdata->dtr_state = active; sierra_send_setup(port); } diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 02402ea3bd1b..52b4194bd31d 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -256,14 +256,14 @@ 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, bool on) +static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool active) { struct spcp8x5_private *priv = usb_get_serial_port_data(port); unsigned long flags; u8 control; spin_lock_irqsave(&priv->lock, flags); - if (on) + if (active) priv->line_control = MCR_CONTROL_LINE_DTR | MCR_CONTROL_LINE_RTS; else diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 4cff39895804..dc85938c368b 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -385,17 +385,17 @@ static int ssu100_tiocmset(struct tty_struct *tty, return update_mctrl(dev, set, clear); } -static void ssu100_dtr_rts(struct usb_serial_port *port, bool on) +static void ssu100_dtr_rts(struct usb_serial_port *port, bool active) { struct usb_device *dev = port->serial->dev; /* Disable flow control */ - if (!on) { + if (!active) { if (ssu100_setregister(dev, 0, UART_MCR, 0) < 0) dev_err(&port->dev, "error from flowcontrol urb\n"); } /* drop RTS and DTR */ - if (on) + if (active) set_mctrl(dev, TIOCM_DTR | TIOCM_RTS); else clear_mctrl(dev, TIOCM_DTR | TIOCM_RTS); diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index 206749fe3263..076667620a3f 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c @@ -262,13 +262,13 @@ 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, bool on) +static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool active) { struct tty_struct *tty = port->port.tty; unsigned int set = 0; unsigned int clear = 0; - if (on) + if (active) set = TIOCM_DTR | TIOCM_RTS; else clear = TIOCM_DTR | TIOCM_RTS; diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index f8404073558b..1ff9d6893026 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -765,13 +765,13 @@ static bool serial_port_carrier_raised(struct tty_port *port) return true; } -static void serial_port_dtr_rts(struct tty_port *port, bool on) +static void serial_port_dtr_rts(struct tty_port *port, bool active) { struct usb_serial_port *p = container_of(port, struct usb_serial_port, port); struct usb_serial_driver *drv = p->serial->type; if (drv->dtr_rts) - drv->dtr_rts(p, on); + drv->dtr_rts(p, active); } static ssize_t port_number_show(struct device *dev, diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h index b2a07dd44225..3f558af789de 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, bool on); +extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool active); 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 168b11cc02b6..78e7d597e2e3 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, bool on) +void usb_wwan_dtr_rts(struct usb_serial_port *port, bool active) { struct usb_wwan_port_private *portdata; struct usb_wwan_intf_private *intfdata; @@ -81,8 +81,8 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on) portdata = usb_get_serial_port_data(port); /* FIXME: locking */ - portdata->rts_state = on; - portdata->dtr_state = on; + portdata->rts_state = active; + portdata->dtr_state = active; usb_wwan_send_setup(port); } diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 9aaed09d45e4..b02e3eeec32f 100644 --- a/drivers/usb/serial/xr_serial.c +++ b/drivers/usb/serial/xr_serial.c @@ -495,9 +495,9 @@ 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, bool on) +static void xr_dtr_rts(struct usb_serial_port *port, bool active) { - if (on) + if (active) xr_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0); else xr_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS);