linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] n_tty: Rename tail to old_tail in n_tty_read()
@ 2022-11-11 14:25 Ilpo Järvinen
  2022-11-14  6:30 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Ilpo Järvinen @ 2022-11-11 14:25 UTC (permalink / raw)
  To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

The local tail variable in n_tty_read() is used for one purpose, it
keeps the old tail. Thus, rename it appropriately to improve code
readability.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

---
 drivers/tty/n_tty.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 597019690ae6..c8f56c9b1a1c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2130,7 +2130,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
 	ssize_t retval = 0;
 	long timeout;
 	bool packet;
-	size_t tail;
+	size_t old_tail;
 
 	/*
 	 * Is this a continuation of a read started earler?
@@ -2193,7 +2193,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
 	}
 
 	packet = tty->ctrl.packet;
-	tail = ldata->read_tail;
+	old_tail = ldata->read_tail;
 
 	add_wait_queue(&tty->read_wait, &wait);
 	while (nr) {
@@ -2282,7 +2282,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
 		if (time)
 			timeout = time;
 	}
-	if (tail != ldata->read_tail)
+	if (old_tail != ldata->read_tail)
 		n_tty_kick_worker(tty);
 	up_read(&tty->termios_rwsem);
 

-- 
tg: (15730dc45dc7..) tty/rename-tail (depends on: tty-next)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] n_tty: Rename tail to old_tail in n_tty_read()
  2022-11-11 14:25 [PATCH] n_tty: Rename tail to old_tail in n_tty_read() Ilpo Järvinen
@ 2022-11-14  6:30 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2022-11-14  6:30 UTC (permalink / raw)
  To: Ilpo Järvinen, linux-serial, Greg Kroah-Hartman; +Cc: LKML

On 11. 11. 22, 15:25, Ilpo Järvinen wrote:
> The local tail variable in n_tty_read() is used for one purpose, it
> keeps the old tail. Thus, rename it appropriately to improve code
> readability.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

-- 
js
suse labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-14  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 14:25 [PATCH] n_tty: Rename tail to old_tail in n_tty_read() Ilpo Järvinen
2022-11-14  6:30 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).