From: Jiri Slaby Date: Wed, 12 Jul 2023 06:42:15 +0000 (+0200) Subject: n_tty: pass ldata to canon_skip_eof() directly X-Git-Tag: v6.6.17~4037^2~197 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32042446c030b677f3bf10081876d9bd078740a2;p=platform%2Fkernel%2Flinux-rpi.git n_tty: pass ldata to canon_skip_eof() directly 'tty' is not needed in canon_skip_eof(), so we can pass 'ldata' directly instead. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230712064216.12150-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index c1859ae..bab7005 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2053,9 +2053,8 @@ static bool canon_copy_from_read_buf(struct tty_struct *tty, * EOF (special EOL character that's a __DISABLED_CHAR) * in the stream, silently eat the EOF. */ -static void canon_skip_eof(struct tty_struct *tty) +static void canon_skip_eof(struct n_tty_data *ldata) { - struct n_tty_data *ldata = tty->disc_data; size_t tail, canon_head; canon_head = smp_load_acquire(&ldata->canon_head); @@ -2153,7 +2152,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, * releasing the lock and returning done. */ if (!nr) - canon_skip_eof(tty); + canon_skip_eof(ldata); else if (canon_copy_from_read_buf(tty, &kb, &nr)) return kb - kbuf; } else {