mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
tty: tty_buffer: initialize variables in initializers already
It makes the code both more compact, and more understandable. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230816105530.3335-10-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
64365743b3
commit
035197c908
@ -262,17 +262,10 @@ static int __tty_buffer_request_room(struct tty_port *port, size_t size,
|
||||
bool flags)
|
||||
{
|
||||
struct tty_bufhead *buf = &port->buf;
|
||||
struct tty_buffer *b, *n;
|
||||
size_t left;
|
||||
bool change;
|
||||
struct tty_buffer *n, *b = buf->tail;
|
||||
size_t left = (b->flags ? 1 : 2) * b->size - b->used;
|
||||
bool change = !b->flags && flags;
|
||||
|
||||
b = buf->tail;
|
||||
if (!b->flags)
|
||||
left = 2 * b->size - b->used;
|
||||
else
|
||||
left = b->size - b->used;
|
||||
|
||||
change = !b->flags && flags;
|
||||
if (change || left < size) {
|
||||
/* This is the slow path - looking for new buffers to use */
|
||||
n = tty_buffer_alloc(port, size);
|
||||
|
Loading…
Reference in New Issue
Block a user