linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 17/17] vt: keyboard, use tty_insert_flip_string in puts_queue
Date: Thu, 29 Oct 2020 12:32:22 +0100	[thread overview]
Message-ID: <20201029113222.32640-17-jslaby@suse.cz> (raw)
In-Reply-To: <20201029113222.32640-1-jslaby@suse.cz>

'puts_queue' currently loops over characters and employs the full tty
buffer machinery for every character. Do the buffer allocation only once
and copy all the character at once. This is achieved using
tty_insert_flip_string instead of loop+tty_insert_flip_char.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/vt/keyboard.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 149f1791d7ec..56b5e8f8fe88 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -324,12 +324,9 @@ static void put_queue(struct vc_data *vc, int ch)
 	tty_schedule_flip(&vc->port);
 }
 
-static void puts_queue(struct vc_data *vc, char *cp)
+static void puts_queue(struct vc_data *vc, const char *cp)
 {
-	while (*cp) {
-		tty_insert_flip_char(&vc->port, *cp, 0);
-		cp++;
-	}
+	tty_insert_flip_string(&vc->port, cp, strlen(cp));
 	tty_schedule_flip(&vc->port);
 }
 
-- 
2.29.1


      parent reply	other threads:[~2020-10-29 11:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 11:32 [PATCH 01/17] vt: keyboard, remove ctrl_alt_del declaration Jiri Slaby
2020-10-29 11:32 ` [PATCH 02/17] vt: keyboard, include linux/spinlock.h Jiri Slaby
2020-10-29 11:32 ` [PATCH 03/17] vt: keyboard, sort includes Jiri Slaby
2020-10-29 11:32 ` [PATCH 04/17] vt: keyboard, sort key types by their number Jiri Slaby
2020-10-29 11:32 ` [PATCH 05/17] vt: keyboard, clean up max_vals Jiri Slaby
2020-10-29 11:32 ` [PATCH 06/17] vt: keyboard, extract vt_kdgkbent and vt_kdskbent Jiri Slaby
2020-10-29 11:32 ` [PATCH 07/17] vt: keyboard, union perm checks in vt_do_kdsk_ioctl Jiri Slaby
2020-10-29 11:32 ` [PATCH 08/17] vt: keyboard, use DECLARE_BITMAP for key_down Jiri Slaby
2020-10-29 11:32 ` [PATCH 09/17] vt: keyboard, use bool for rep Jiri Slaby
2020-10-29 11:32 ` [PATCH 10/17] vt: keyboard, rename i to kb_func in vt_do_kdgkb_ioctl Jiri Slaby
2020-10-29 11:32 ` [PATCH 11/17] vt: keyboard, reorder user buffer handling " Jiri Slaby
2020-10-29 11:32 ` [PATCH 12/17] vt: keyboard, extract and simplify vt_kdskbsent Jiri Slaby
2020-10-29 11:32 ` [PATCH 13/17] vt: keyboard, remove unneeded func_* declarations Jiri Slaby
2020-10-29 11:32 ` [PATCH 14/17] vt: keyboard, union perm checks in vt_do_kdgkb_ioctl Jiri Slaby
2020-10-29 11:32 ` [PATCH 15/17] vt: keyboard, make HW_RAW a function Jiri Slaby
2020-10-29 11:32 ` [PATCH 16/17] vt: keyboard, use find_next_bit in kbd_match Jiri Slaby
2020-10-29 11:32 ` Jiri Slaby [this message]

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=20201029113222.32640-17-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).