提交 c35f638f 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

vt: keyboard, use tty_insert_flip_string in puts_queue

'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: NJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20201029113222.32640-17-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2389cdc3
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册