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: 4980 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp227156wrs; Wed, 19 Oct 2022 02:47:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OcAxD1YajXIBcwXB23x/MqT5V/q6PcWRD6M6v9Ajbgus0rQQ5ZPshTC6dgoGtGjpWPJVK X-Received: by 2002:a17:902:9690:b0:17a:4cf:edeb with SMTP id n16-20020a170902969000b0017a04cfedebmr7509156plp.129.1666172877791; Wed, 19 Oct 2022 02:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172877; cv=none; d=google.com; s=arc-20160816; b=mo/Ja+5/0p1nyeLTEDXOSk6gBx8ViH96wGkDJwLTzOjem5J9MeCfAJBqg/XgW2ErJX e2uiot44wi4zwsSGX+VltYbappGrghK4Duk/qsUCk7vKA1sMc/6dtKMBXkV170B0xHno duVATOABcJ7BJftTqyyxegQP/gsVDcwMknFNlh6PJF2s0e0qW1Rju9GL2WCtOVwzj1a5 0MEykoUKcd++PjT5yLwr8lfSHamXl8qtKz2HXWDEqGq9InYc4LoqLjN6sRRZPNBZOyl3 mdnAPO73HyAQLtoQxMhlE1VP25rqxtDkKEtcg/GhsQy6BWcwRs0yIaJVokvrK4xalQnF HsGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u2ZpuHhdZFOFuicBpiJ8o/0oo/tlmtmd9bTLy8P2dLA=; b=T3OY4yQIYWkaW+FapRCwwmfJu1Po5KUgeNUrV20PWrvVKgOK+ouP6kjlgMamr1/Kuv Ny54Lw2ZBkxAM5HHGYMaxii6WKaUUAED9CnJZfif8QMTuE0vnxmUc8Hx5D+o0FHC46V/ CCSPTuSv60FQpvvA1uP2TAZ8x37A2AIa33GENTxNCMfWqKGh7Cq6dpemVPmUeJ/UskFi 6oABm8zmnT3pZQYH3YzswXXNlug7KU+Cl9hgFJmoxD1ecoG2CZpnI35J9rTqKXFdPNTq s5BP0B1THe5uSasaeCelMaz5cw+jvMYgy7LU1pxjVKO11LJWBOeOUYuEQz6dJvpMHLxE ptyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ViwfHK4K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a63520d000000b004609faa2dbesi17397855pgb.285.2022.10.19.02.47.43; Wed, 19 Oct 2022 02:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ViwfHK4K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234055AbiJSJhw (ORCPT + 99 others); Wed, 19 Oct 2022 05:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233582AbiJSJbG (ORCPT ); Wed, 19 Oct 2022 05:31:06 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4F8C6955; Wed, 19 Oct 2022 02:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170844; x=1697706844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SVyuluNhKfUl6XPBNwDdqJifQkuYh/oy8JzAs+w5pCs=; b=ViwfHK4Kb2V8QWDfNq5qssNPuvj6xBqQRW7C7ywNKqfIWXiFwV7aQSze iU6RbGQCrXIzAGJIDo3X4u/tmRF2Ewi5HF4O7LqNSycuLN2/h86vIKY80 cehmVBuoYpB/xKC4UfLKDzvFfGEBS4EsR6S+dnZkVs2w4XJNQuu2V3vUG DFE82aP90R78d474jeKtuPOJV22PJrcBCdeOVwfMzLkcsJCf+weCcRgMb jdU8V0RR6Arl+5/J0oP5ziYaVMf8eNkkwQx3kqIe6j6KRzvP97eTOzeLZ Swp5Oi8PyQn7RmGSEgpn+gMfFphq+aQOwIgvExYYxjwpm77MvgFShUvAZ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="332910913" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="332910913" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.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-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747108891272723125?= X-GMAIL-MSGID: =?utf-8?q?1747108891272723125?= 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 */