From patchwork Wed Oct 19 09:11:18 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: 13011503 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 A46A4C43217 for ; Wed, 19 Oct 2022 09:14:29 +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=cxULGaTjYN+tHjYhwng6TZjFfeC0wJrRyzgxyTSdpAU=; b=ePcTIimRZRlkDq T69S6DFLB/kIH7Qsz3hrKszU9npe5aYQ3M73d8OZ7vNPngIR7ybbZ72xW4lYztHbO+Y/mpI99TJhm gURndATeU+bon+vpYOMNXrHzRdHd4OmYNBJZDwok05dby9bMnLvoerrb6Cy9dvHunWh3Ljs2SZuE5 RhfVDS376x1FBXc1+zH30I7EyITiDGbjKFk55B2aHlMIEYyFhFc4zBIjFSt1qizYqCABT2OTrtl9S WCtWPNfFBolp4Yh6aN/4tfn5VVuvWIG/xuuLb5ku7S7MVKA/aF+8hx8d9b9IfbVdXfynwZqtKrFqk /pgNa22a9mul5aoQoMWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol58d-00HFy9-KR; Wed, 19 Oct 2022 09:13:23 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol58Z-00HFuu-UU for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 09:13:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170799; x=1697706799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SVyuluNhKfUl6XPBNwDdqJifQkuYh/oy8JzAs+w5pCs=; b=bh3WZT2GPGQnNOmgPmDiQvrj+BXDM4T2Kr1rLvLxN+wKUpDUT8sGcIoc SlcGDfN924ydO6vu9vwLuOUq+x+bhzmmeVXjBZI8fgKS4+/rHk5579vG3 Yu3ctMbocDAqoaSUYw0JxFWAcEcB7QuhKdy25ULfA9aZyV6eHdoapoqBp R19AwA8tW66nsETDctS0A9znmXuhqs6yw19hVna8BCMAMouWKdq+0ejN+ jw9z5kUnJFUkrYEQyzJsgca4e9mGXj6FIKUo10IbOKwBZdA2Nbk1vxIs+ ckMiryens5mK+lYkjca3TMgVPr6r05fL7HyTl8qwUauQvFfh3tD0nGkUC A==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="392656096" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="392656096" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:12:58 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734118651" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734118651" 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:12:54 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , 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 11/44] serial: atmel: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:18 +0300 Message-Id: <20221019091151.6692-12-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_037536_42E01412 X-CRM114-Status: GOOD ( 10.81 ) 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: Claudiu Beznea Acked-By: Richard GENOUD --- drivers/tty/serial/atmel_serial.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index bd07f79a2df9..4485f2d26b77 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -875,10 +875,7 @@ static void atmel_complete_tx_dma(void *arg) if (chan) dmaengine_terminate_all(chan); - xmit->tail += atmel_port->tx_len; - xmit->tail &= UART_XMIT_SIZE - 1; - - port->icount.tx += atmel_port->tx_len; + uart_xmit_advance(port, atmel_port->tx_len); spin_lock_irq(&atmel_port->lock_tx); async_tx_ack(atmel_port->desc_tx); @@ -1471,11 +1468,7 @@ static void atmel_tx_pdc(struct uart_port *port) /* nothing left to transmit? */ if (atmel_uart_readl(port, ATMEL_PDC_TCR)) return; - - xmit->tail += pdc->ofs; - xmit->tail &= UART_XMIT_SIZE - 1; - - port->icount.tx += pdc->ofs; + uart_xmit_advance(port, pdc->ofs); pdc->ofs = 0; /* more to transmit - setup next transfer */