public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Subject: [PATCH 02/14] tty: n_tty: use output character directly
Date: Wed, 16 Aug 2023 12:58:08 +0200	[thread overview]
Message-ID: <20230816105822.3685-5-jirislaby@kernel.org> (raw)
In-Reply-To: <20230816105822.3685-1-jirislaby@kernel.org>

There is no point to use a local variable to store the character when we
can pass it directly. This assignment comes from era when we used to do
get_user(c, b). We no longer need this, so fix this.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
 drivers/tty/n_tty.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 8b2bacb3e40d..f6fa4dbdf78f 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2373,8 +2373,7 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
 				nr -= num;
 				if (nr == 0)
 					break;
-				c = *b;
-				if (process_output(c, tty) < 0)
+				if (process_output(*b, tty) < 0)
 					break;
 				b++; nr--;
 			}
-- 
2.41.0


  parent reply	other threads:[~2023-08-16 11:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 10:58 [PATCH 00/14] tty: n_tty: cleanup Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 1/4] n_tty: drop fp from n_tty_receive_buf_real_raw() Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 01/14] tty: n_tty: make flow of n_tty_receive_buf_common() a bool Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 2/4] n_tty: simplify and sanitize zero_buffer() Jiri Slaby (SUSE)
2023-08-16 10:58 ` Jiri Slaby (SUSE) [this message]
2023-08-16 10:58 ` [PATCH 3/4] n_tty: pass ldata to canon_skip_eof() directly Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 03/14] tty: n_tty: use 'retval' for writes' retvals Jiri Slaby (SUSE)
2023-08-16 14:21   ` Ilpo Järvinen
2023-08-16 10:58 ` [PATCH 4/4] n_tty: make many tty parameters const Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 04/14] tty: n_tty: use time_is_before_jiffies() in n_tty_receive_overrun() Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 05/14] tty: n_tty: make n_tty_data::num_overrun unsigned Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 06/14] tty: n_tty: use MASK() for masking out size bits Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 07/14] tty: n_tty: move canon handling to a separate function Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 08/14] tty: n_tty: move newline " Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 09/14] tty: n_tty: remove unsigned char casts from character constants Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 10/14] tty: n_tty: simplify chars_in_buffer() Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 11/14] tty: n_tty: use u8 for chars and flags Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 12/14] tty: n_tty: unify counts to size_t Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 13/14] tty: n_tty: extract ECHO_OP processing to a separate function Jiri Slaby (SUSE)
2023-08-16 10:58 ` [PATCH 14/14] tty: n_tty: deduplicate copy code in n_tty_receive_buf_real_raw() Jiri Slaby (SUSE)
2023-08-16 11:02 ` [PATCH 00/14] tty: n_tty: cleanup Jiri Slaby
2023-08-16 11:20   ` Greg KH

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=20230816105822.3685-5-jirislaby@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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