From patchwork Wed Oct 19 09:11:24 2022 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: 13011505 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 A5D2BC433FE for ; Wed, 19 Oct 2022 09:14:51 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BV4y+FBB9m5HpP+HMA7l8V7U+0d8Jw2qFEC5cSDbBFw=; b=UJ6Ii/VF0BILBo vKDzeqAbFeMkDZfK3kYg3YzLRIar+3qMwnXHhvYKJFaVAqmBX0M/fhMdb/7WbtRXpSo+8wg+g+GKB jy9qZmgIKkvv8BO1PEVD30NAinlNknCnr19PG9y9Q6oDvY3iPvP8jFBlfx1m7IA+NHHKYOsKcSbti fwWgNqt4ocP5zeyxcCLaMA+OSmSUGbyVCJvAakfuPMtzLNRheLFF8UVxznm0NaNUg8aIMJdpoYZfA +5kyUZjus+EcDLrdvLV8W8G8ehf3y/wvRVTqFoxRhpGBTM4jPWhV7UqAt0aHGYLXkOELJszlPe/jO 4PhInTM5BtIALeicTIIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol596-00HGFf-8w; Wed, 19 Oct 2022 09:13:52 +0000 Received: from mga12.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol58a-00HFvL-Hy for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 09:13:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170800; x=1697706800; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LfL2WHC8lVbuBm2BucTh8bRu07F0VUCsL+ehIqnzvLQ=; b=ALJMq+fek8kI9cbNA5XW0S60/zmem0pOG7foInHcECyIEpiHu2dECIUT 2lN5YFMgWSo8l6tN4e6fayaHJiv1VNAJYia4ckx8itsREgT8CAyprr499 OqCJLW2eCs2F3QHk9Jcn8lrRCUjHV5jz2FRrfwrK5V0/fK4wmWT9Ar7cN 4TLyx2uawngfQ7EYOmRhjjuyK9VzTDfh++1naPzgMClJhVnFNW+QsuWs6 EI0NhfKl0gGoQVyZ+rxFAzuNYjmCMAmBhKRK5NBYAAJWgJuaTPbEnZ6se scsj8DMucpjHjFALWDMhpm6djmPE4QusFB0+RZSN2eHSkuwNxKOk0bEMI Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="286072576" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="286072576" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:13:17 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734118794" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734118794" Received: from sponnura-mobl1.amr.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.214.35]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:13:13 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH 17/44] serial: imx: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:24 +0300 Message-Id: <20221019091151.6692-18-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com> References: <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_021320_638110_6F5CCE5D X-CRM114-Status: GOOD ( 11.33 ) 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 Take advantage of the new uart_xmit_advance() helper. Signed-off-by: Ilpo Järvinen Reviewed-by: Uwe Kleine-König --- drivers/tty/serial/imx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 05b432dc7a85..a7548d0a1aee 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -563,8 +563,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport) /* send xmit->buf[xmit->tail] * out the port here */ imx_uart_writel(sport, xmit->buf[xmit->tail], URTX0); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - sport->port.icount.tx++; + uart_xmit_advance(&sport->port, 1); } if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) @@ -590,9 +589,7 @@ static void imx_uart_dma_tx_callback(void *data) ucr1 &= ~UCR1_TXDMAEN; imx_uart_writel(sport, ucr1, UCR1); - /* update the stat */ - xmit->tail = (xmit->tail + sport->tx_bytes) & (UART_XMIT_SIZE - 1); - sport->port.icount.tx += sport->tx_bytes; + uart_xmit_advance(&sport->port, sport->tx_bytes); dev_dbg(sport->port.dev, "we finish the TX DMA.\n");