vt: make tc write more obvious in vc_con_write_normal
authorJiri Slaby <jslaby@suse.cz>
Mon, 15 Jun 2020 07:48:54 +0000 (09:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:08:33 +0000 (17:08 +0200)
commitf1bcbe141381a9f715f90d61003d6b47fe084d04
tree78dcc4807ff25b822c6b4316cd18f82fa4fe76db
parentf3205b29be7a18a198491004d058f3fc9d6eaf79
vt: make tc write more obvious in vc_con_write_normal

Nested ternary operators spread over 4 lines are really evil for
reading. Turn the outer one to proper 'if'. Now, we see, there is a
common path, so the code can be simplified. This way, the code is
understandable now.

Checked using symbolic execution (klee), that the old and new behaviors
are the same.

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