From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5E9AC4708E for ; Thu, 5 Jan 2023 19:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-ID:Content-Type: MIME-Version:References:Message-ID:In-Reply-To:Subject:cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LLw6BtbRgfZEhmzBQ1m8aApMpKnR3qAe6ptGOowhoW8=; b=u4SAjxEyElrpv3CwycZ3FEuGSk DWX3y3EAoK+PCUAGrJcgDE9pUGGMfjwv7Uj0y3bwiPxs6/y6B0+T6qLksRT4OUt9Zw1rR6hbVRWsy XXyYe63RwzL/r8uQezfhOq4iKEeyzOkzXEPpQAd/mtvZeo81ec6cy3kMq6I/KU2pkKzV19WWCHuvr G8+Uni6lYwzaMeF63uA8c6VMu45yAPJdfTPL/NicicnEgJZupQ8B1ou3zzmzogW/yvH36jKmqibtT //Q9x2PEA1dvBO7LmCHYWhdJ8xzlSkKoEwwIjIzxBLa6wYszfsACdzGUQeOyls81RBFX4F2f1chIB tuw+31VA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDW43-00EBPX-IC; Thu, 05 Jan 2023 19:38:12 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDLy5-0090HP-8M for linux-arm-kernel@lists.infradead.org; Thu, 05 Jan 2023 08:51:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672908681; x=1704444681; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=MdpIx0ME+Xfwg6tq/OLwhK9h6Pxxj28cKiqlNMlnOkE=; b=fPLNwBF9eREbDR+lxwzQq18cl2Wk2bF+MGGg+bqSWHB+oIUeYoQMVfBo 8qJC++QplkxbRg+BreHJIOCAZgQQ/gU7Va5pIXVxZc+70yrG6Zbpfd7Yx 946Y/qWU/nEn2ce1HMs5mJk9KGhTTSi5aq2He5+ImE9i8p3Tr9WFTvo4+ 1RPhkOeDYRzIyr+hgdF9Gs1WAgSVuXVPYBGD3cqPMvW6AS37NtIEWh1WN gkSGiO5ZX4GEU+qLh2ZEtl6rkxkv7dDZeIVnTqjOhlj3exPu2xnNauHdN OCWcMbaunH4WOjTXr0Ngyeaexb/YmJ3qVImiYKfbJmFXPzUegtLpUBBfF A==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="319860916" X-IronPort-AV: E=Sophos;i="5.96,302,1665471600"; d="scan'208";a="319860916" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2023 00:51:17 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="655496263" X-IronPort-AV: E=Sophos;i="5.96,302,1665471600"; d="scan'208";a="655496263" Received: from khaunx-mobl1.ger.corp.intel.com ([10.252.35.181]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2023 00:51:12 -0800 Date: Thu, 5 Jan 2023 10:51:10 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jiri Slaby cc: linux-serial , Greg Kroah-Hartman , Arnd Bergmann , Ulf Hansson , David Lin , Johan Hovold , Alex Elder , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Oliver Neukum , LKML , 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 Subject: Re: [PATCH 07/10] tty: Convert ->dtr_rts() to take bool argument In-Reply-To: <09043f30-c516-e173-3836-5e5dd5f5c472@kernel.org> Message-ID: <2cb9b67e-9bb-4fb2-e974-17050457d3@linux.intel.com> References: <20230104151531.73994-1-ilpo.jarvinen@linux.intel.com> <20230104151531.73994-8-ilpo.jarvinen@linux.intel.com> <09043f30-c516-e173-3836-5e5dd5f5c472@kernel.org> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1066211675-1672908637=:1832" Content-ID: <4fbbebce-aab4-fa64-6a79-6d25c81fe3c@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_005121_354439_FDFB98F6 X-CRM114-Status: GOOD ( 25.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1066211675-1672908637=:1832 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: <207e8c25-d560-4d87-27a8-5f9cb52ce14@linux.intel.com> On Thu, 5 Jan 2023, Jiri Slaby wrote: > On 04. 01. 23, 16:15, Ilpo Järvinen wrote: > > 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. > > Reviewed-by: Jiri Slaby > > > Signed-off-by: Ilpo Järvinen > > --- > ... > > --- 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); > > Not anything for this patch, but having this dubbed "onoff" instead of "on" > makes it really confusing. > > > --- 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); > > Especially here. What does "!onoff" mean? If it were: > > if (on) > sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS); > else > sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); > > it would be a lot more clear. > > > --- 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) > > Or "raise". That makes sense too and we call it as such in > tty_port_operations: > > > --- a/include/linux/tty_port.h > > +++ b/include/linux/tty_port.h > ... > > @@ -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); > > Care to fix that up too? Sure. I noticed they were inconsistent but it didn't feel like changing the name "while at it" would be good as this is long already. I think I'll make another patch out of the name changes. -- i. --8323329-1066211675-1672908637=:1832 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --8323329-1066211675-1672908637=:1832--