From patchwork Fri Sep 23 08:02:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12986273 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 41B26C6FA82 for ; Fri, 23 Sep 2022 08:04:31 +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=5+VmIo7NiFhHkkW4YHbipm5iH9H8XrQ3g3ARbqYgOiA=; b=lSyvxRngz1OBLd 94eMk6t/YpsPTCN2jgVy90jhxfJnxjppQsquTjF04jx0quv/X31qFgbhsnRpbn9tEYG1CYUxel0n2 VhzkgpKItgVxMGOcjHd1CWFQ/XnpTQWEChqErx9l8igYg+KFuKLcem3UlGF3s+tAoyY0khvSzD7oZ 86DTfivam6rXHBPAM/HAoG2i/jt4xcZcxw2jnuIU8HUS999VPdKcBtIdYJSnnXPLqD3pbGzqU4/8+ 57ZzFBFbY/9Z07NUm3OVBb+btHNoU5rc6kn/NACHnPGidlk9UTElbV7tdfpo22suBmgoJ/5CixbkF IPwUo4ETZ9OrW5YmiRcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obdeg-002pdd-PA; Fri, 23 Sep 2022 08:03:26 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obdee-002pcV-0O for linux-arm-kernel@lists.infradead.org; Fri, 23 Sep 2022 08:03:25 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 390F76148B; Fri, 23 Sep 2022 08:03:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41778C433D6; Fri, 23 Sep 2022 08:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663920202; bh=w/kHs4h55sKARjZx8ANrnEmBR7IEQjYbRNzLqXKQi+Q=; h=Subject:To:From:Date:From; b=MPiW+zUjVXPa4dDkUwpP5VvFrIZ5gUQA5/vvO+K1R5vUZzY5gFK0eKB7vQbJTcO2H gKuLKliJLDLcJVzhHtr3RJ2ICCjj9yo8KSYqlMVtwS2N/l90zFRy0IUbce2YKxP63m q8mLA3a3nDMnUYxh+Rwe60m7itMKZcFzB9Umpwh8= Subject: patch "tty: serial: move and cleanup vt8500_tx_empty()" added to tty-next To: jslaby@suse.cz,gregkh@linuxfoundation.org,ilpo.jarvinen@linux.intel.com,linux-arm-kernel@lists.infradead.org From: Date: Fri, 23 Sep 2022 10:02:38 +0200 Message-ID: <166392015850168@kroah.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220923_010324_114375_D108021C X-CRM114-Status: GOOD ( 17.40 ) 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-next 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 also be merged in the next major kernel release during the merge window. 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;