From patchwork Wed Oct 19 09:11:41 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: 13011512 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 98CEDC4332F for ; Wed, 19 Oct 2022 09:16:40 +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=+4wmObwss7Gg7OO7jFA7LGSjjzLSTLBy/QXfZVQ5aWE=; b=n5m5yhrSx5J98r zwYsgja0W+C/gUQUlogY6EU4tvkw42gD5Tapxl02ZVH89+RzseEuZc15KqrwmzHWI7keNYfKUWQdE KG+XYi091UvyqrgedA4QjhcWGLB0EJF6jpV7IYMYSBKbupbErN3Ev4+6SG77pRn4UI8AlFApViyvQ USXHz39R1hBkcdbOnKhAt0TV3MJfWsmwK4fuBaEcSNOAuNnPItZ/G/eENq+HvZ+q4iGLuzz0SdHmA bYvh+I/GIbPFR1rWTlp2vI7LrpQQeG8w/YYva/1WuespIsxPqYrK0vgWczN+vQRdRfD6dvT3wQHr1 kD6O8s+AYLlhQYhxJzzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol5Ag-00HHV1-FV; Wed, 19 Oct 2022 09:15:31 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol59V-00HGYv-K3 for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 09:14:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170857; x=1697706857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VQJoRuNRdeIpnDk2ac87eJh17oqgdcNVue8yLDhtyxs=; b=beHh8wt1lBKONMEdm1ksp7YzMK6XVmHkp/1Ii6Y0qrUkF/DxnTf7bJks SGHy3g1Y33pKo9duwQP64ucO8d6GSrs59/vhGSsbUINehzQcLJsJDIQty ZZbdBYkaDBEk97Got9mL1SzJ60WbP87quY1fcBeYgmV3eDHKYjkzBVryM lgw/R75URgnxucxci7TQ6vkho1chQhprcpakaoqxfEhhfY92oJECo3Ig1 1l+XKXptVOdNpK7Z9bG4HPksBTSRGGaoQMRNpU3tHZ17nYS10ysGSSDW2 Q9obSttq1YeUlXdlBcESPVatqLQ0GkdTfJ1bpmmQIKN+ZkushGW1IsyHI g==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="306344613" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="306344613" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:14:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734119215" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734119215" 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:14:13 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com, 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 34/44] serial: stm32: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:41 +0300 Message-Id: <20221019091151.6692-35-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_021417_703103_CDD1FFCE X-CRM114-Status: GOOD ( 10.85 ) 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 --- drivers/tty/serial/stm32-usart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index dfdbcf092fac..24def72b2565 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -596,8 +596,7 @@ static void stm32_usart_transmit_chars_pio(struct uart_port *port) if (!(readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE)) break; writel_relaxed(xmit->buf[xmit->tail], port->membase + ofs->tdr); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart_xmit_advance(port, 1); } /* rely on TXE irq (mask or unmask) for sending remaining data */ @@ -673,8 +672,8 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port) stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT); - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); - port->icount.tx += count; + uart_xmit_advance(port, count); + return; fallback_err: