mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
nozomi: simplify ntty_chars_in_buffer
ntty_chars_in_buffer is overly complicated. Simplify it by inverting the condition. Side FIXME: how can dc or port be NULL here? Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210505091928.22010-29-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fff4ef17a9
commit
3d18354248
1 changed files with 3 additions and 8 deletions
|
@ -1780,16 +1780,11 @@ static unsigned int ntty_chars_in_buffer(struct tty_struct *tty)
|
|||
{
|
||||
struct port *port = tty->driver_data;
|
||||
struct nozomi *dc = get_dc_by_tty(tty);
|
||||
s32 rval = 0;
|
||||
|
||||
if (unlikely(!dc || !port)) {
|
||||
goto exit_in_buffer;
|
||||
}
|
||||
if (unlikely(!dc || !port))
|
||||
return 0;
|
||||
|
||||
rval = kfifo_len(&port->fifo_ul);
|
||||
|
||||
exit_in_buffer:
|
||||
return rval;
|
||||
return kfifo_len(&port->fifo_ul);
|
||||
}
|
||||
|
||||
static const struct tty_port_operations noz_tty_port_ops = {
|
||||
|
|
Loading…
Reference in a new issue