n_tty: move lnext handling
authorJiri Slaby <jslaby@suse.cz>
Wed, 5 May 2021 09:18:59 +0000 (11:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 May 2021 14:57:16 +0000 (16:57 +0200)
commit67a620d58b47b6683da7f8152baa4384f74b19f8
tree5b60c90fca607b0fa44a43a6c02255c19fdbe91b
parent95aafe3278e7f16910eeef59c0664b1d23dcdda0
n_tty: move lnext handling

Move lnext handling from __receive_buf to n_tty_receive_buf_standard. It
simplifies the handling as it needs not fetching 'flag' and decrement
'count' in __receive_buf. Instead, all this is left up to the loop in
n_tty_receive_buf_standard which already does that.

This way, no need to repeat the action when n_tty_receive_char_special
returns true -- ldata->lnext is set there in that case, so the 'if
(ldata->lnext)' check is sufficient. The next patch will switch
n_tty_receive_char_special to return 'void'.

The result is much simplified code flow.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210505091928.22010-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c