tty: n_tty: simplify chars_in_buffer()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Sun, 27 Aug 2023 07:41:43 +0000 (09:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Aug 2023 09:46:52 +0000 (11:46 +0200)
commitd88c3c2675f9d41c15297fa001e79812f4dcc9dd
treec0fccd1f8a9e450515a6514ec3ff4de9c8bd2ed3
parent046b44ab0f5a87ba5788606155c5a6761169616a
tty: n_tty: simplify chars_in_buffer()

The 'if' in chars_in_buffer() is misleadingly inverted. And since the
only difference is the head used for computation, cache the head using
ternary operator. And use that in return directly.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230827074147.2287-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c