public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Jiri Slaby <jirislaby@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/3] serial: core: Don't count XON/XOFF in the statistics
Date: Wed,  3 Apr 2024 17:46:15 +0300	[thread overview]
Message-ID: <20240403144722.860258-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240403144722.860258-1-andriy.shevchenko@linux.intel.com>

Don't count XON/XOFF in the statistics in __uart_port_tx().
It will make it in align with other serial drivers. With
this change we may use uart_xmit_advance() API instead of
open coded analogue.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/serial_core.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 0a0f6e21d40e..9579d70a367e 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -767,7 +767,7 @@ enum UART_TX_FLAGS {
 	struct circ_buf *xmit = &__port->state->xmit;			      \
 	unsigned int pending;						      \
 									      \
-	for (; (for_test) && (tx_ready); (for_post), __port->icount.tx++) {   \
+	for (; (for_test) && (tx_ready); (for_post)) {			      \
 		if (__port->x_char) {					      \
 			(ch) = __port->x_char;				      \
 			(put_char);					      \
@@ -780,7 +780,7 @@ enum UART_TX_FLAGS {
 									      \
 		(ch) = xmit->buf[xmit->tail];				      \
 		(put_char);						      \
-		xmit->tail = (xmit->tail + 1) % UART_XMIT_SIZE;		      \
+		uart_xmit_advance(__port, 1);				      \
 	}								      \
 									      \
 	(tx_done);							      \
-- 
2.43.0.rc1.1.gbec44491f096


  reply	other threads:[~2024-04-03 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 14:46 [PATCH v1 0/3] serial: Do not count XON/XOFF in the statistics Andy Shevchenko
2024-04-03 14:46 ` Andy Shevchenko [this message]
2024-04-03 14:46 ` [PATCH v1 2/3] serial: fsl_lpuart: Don't " Andy Shevchenko
2024-04-03 14:46 ` [PATCH v1 3/3] serial: sprd: " Andy Shevchenko
2024-04-03 22:15 ` [PATCH v1 0/3] serial: Do not " Andy Shevchenko
2024-04-04  5:16   ` Jiri Slaby
2024-04-04 15:54     ` Andy Shevchenko
2024-04-09 13:46       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403144722.860258-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox