From patchwork Wed Oct 19 09:11:35 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: 13011509 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 D558CC4167B for ; Wed, 19 Oct 2022 09:16:22 +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=C4ogQktDTHMF2R+ozX4lt91b6lJuOEAQJ7L3SlQ6oGw=; b=e+FELqoQ48ripW aaXik/DVCB9ObmvvmFp3GK52h8v9nXR8srkRMm+u00e3KaL/JaGERfYNpNnihSKX8nz7jKiEWWIqi DqBMOZh2TbUbwkeBIsD320KVA20OYI4nR6yadN3Lq4X6K4JtHM7R19qeoB0EN2MZTnYYWpiwgMIki K3emv4W3FyhHV6CX1j02CqtMNtzCVKm4tdSWf0rPPJdYpP1xgzNvhOs+qCCGM5OPcLbcfpTvB7Owk oQvf65pl07GRq/DZDzfzHfa79VlNKRkjqVefKgYKZIdXtCDarPV3+yHh6ozMjs1gYnNzZGX55N/jC uUYwvAPm+GfHzqLIk8lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol5AO-00HHHR-BB; Wed, 19 Oct 2022 09:15:12 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol59B-00HGGd-6v for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 09:14:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170837; x=1697706837; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QeLyseBRR5vdFFcCj6zBy2vHybO02Bt4+xdUVAJfGkQ=; b=FeexKKqKB+Gw6tS7E+d6ATYSj+2UzgV1vrs87doC8DNYQyc/cV5kDc8M XpJXnc+0igVVAQxN0Ah/81r/IDwPGsthm5fVhLDRJ/PYZFS3icHMmwp0f Sm/dhRHCyv6n7WKoXCEsVX0Fg8A6Dpz1VAvQdznVnNEMeAkyurKIyHhWk ltRu6aNyb/GUxppipD5/qSSQpcnhxlFUehFYGyUbBh2+c2cm3lu2qlLoC UiWJhx99CEssvEDAUlNjtwps+LBWk1oZwYi7bl5zo7OipK9qXVOOn5pCz 9lZWigFfGx/wp3jCPBc/zpzHbMBLmY5xNTy3igOCG3//rA+EWW4lxZml5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="293751044" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="293751044" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:13:56 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734119081" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734119081" 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:53 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH 28/44] serial: samsung_tty: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:35 +0300 Message-Id: <20221019091151.6692-29-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_021357_345925_6A21C636 X-CRM114-Status: GOOD ( 12.95 ) 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: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 77d1363029f5..7e34361a1085 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -288,7 +288,6 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); struct s3c24xx_uart_dma *dma = ourport->dma; - struct circ_buf *xmit = &port->state->xmit; struct dma_tx_state state; int count; @@ -316,8 +315,7 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port) DMA_TO_DEVICE); async_tx_ack(dma->tx_desc); count = dma->tx_bytes_requested - state.residue; - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); - port->icount.tx += count; + uart_xmit_advance(port, count); } ourport->tx_enabled = 0; @@ -351,8 +349,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args) spin_lock_irqsave(&port->lock, flags); - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); - port->icount.tx += count; + uart_xmit_advance(port, count); ourport->tx_in_progress = 0; if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) @@ -916,8 +913,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport) break; wr_reg(port, S3C2410_UTXH, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart_xmit_advance(port, 1); count--; }