From patchwork Thu Sep 22 14:14:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12985222 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 4113EC6FA82 for ; Thu, 22 Sep 2022 14:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:From:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cffqhP4GcD2z7diCsoBk03bR2FA3Z905lbteyEGcEBA=; b=k6tfhJB3inADtw h7PZOekdZUAE1dopAZ6z3pqUlphODeS4D9gDKZHxY/3rAYgAjEtdzlxRpKJVTTf86nA2oaR1eBOJD GaKK9MKgtxsK3jSFQUPLg2sjLmx8vynMKlJY6KGVHz0/c93qCPI0xnqFLi6NNVaSLEb8aDd9E9osT tZybfPZGFFjbf65bZ+kh7bXL+S57bkWkvzru/kyilAAN3QulDdEShEjvuGP1YEDngqRPbhstuXKi2 YSprvuIpw8ZFV53+lDVKHXPH3fPsVc29BG4G/1XbCIa7jZyl6vooBvybZKNOtpnJpgT8vapLiOX6T 1F+Msodme3Pzl6yvhsJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMyZ-00FvQ7-Gg; Thu, 22 Sep 2022 14:14:51 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMyW-00FvOw-70 for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 14:14:49 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 799B1B8376C; Thu, 22 Sep 2022 14:14:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD700C433C1; Thu, 22 Sep 2022 14:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663856085; bh=FHJ/AQzohwX2fn/ItBTnvKz2Lae6dLXQzdx2H6Um8ug=; h=Subject:To:From:Date:From; b=gbGkHhgSXJtYpnxeHvb430iflj7hd8QY7DAajbM6kFPHAIFV1IJJ1FvdjXfAAQXPj Cdt4cW8BxInkIDvxITvQ6yCqNN5EOEaIg/WR+02PS448pS7mZxmET34BJWPeMIjbEy IdFk/BHq7qG4/HaE7T+pvRZNJiPKN6Fb4XJewpYw= Subject: patch "tty: serial: move and cleanup vt8500_tx_empty()" added to tty-testing To: jslaby@suse.cz,gregkh@linuxfoundation.org,ilpo.jarvinen@linux.intel.com,linux-arm-kernel@lists.infradead.org From: Date: Thu, 22 Sep 2022 16:14:42 +0200 Message-ID: <166385608220446@kroah.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_071448_429730_CE50B4C0 X-CRM114-Status: GOOD ( 17.75 ) 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 is a note to let you know that I've just added the patch titled tty: serial: move and cleanup vt8500_tx_empty() to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-testing branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will be merged to the tty-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. From 0c0bfc6b14388356ce6016b9d548ac8b874013e0 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 20 Sep 2022 07:20:41 +0200 Subject: tty: serial: move and cleanup vt8500_tx_empty() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make vt8500_tx_empty() more readable by introducing a new local variable and move the function before handle_tx(). That way we can reuse it in there too. Cc: Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/vt8500_serial.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 508ad7afa6de..10fbdb09965f 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -187,6 +187,13 @@ static void handle_rx(struct uart_port *port) tty_flip_buffer_push(tport); } +static unsigned int vt8500_tx_empty(struct uart_port *port) +{ + unsigned int idx = vt8500_read(port, VT8500_URFIDX) & 0x1f; + + return idx < 16 ? TIOCSER_TEMT : 0; +} + static void handle_tx(struct uart_port *port) { struct circ_buf *xmit = &port->state->xmit; @@ -201,7 +208,7 @@ static void handle_tx(struct uart_port *port) return; } - while ((vt8500_read(port, VT8500_URFIDX) & 0x1f) < 16) { + while (vt8500_tx_empty(port)) { if (uart_circ_empty(xmit)) break; @@ -260,12 +267,6 @@ static irqreturn_t vt8500_irq(int irq, void *dev_id) return IRQ_HANDLED; } -static unsigned int vt8500_tx_empty(struct uart_port *port) -{ - return (vt8500_read(port, VT8500_URFIDX) & 0x1f) < 16 ? - TIOCSER_TEMT : 0; -} - static unsigned int vt8500_get_mctrl(struct uart_port *port) { unsigned int usr;