vt: deduplicate setGx code
authorJiri Slaby <jslaby@suse.cz>
Mon, 15 Jun 2020 07:48:36 +0000 (09:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:08:31 +0000 (17:08 +0200)
commitb4d92b6575ac3c2d0ed8310d6b8279968dca10b8
treeb20e4eb8ca9e4d4f18a90177533a770b4d4cb2e4
parent77bc14f273c2dfecbf87f41fdc00345d99597e13
vt: deduplicate setGx code

The code for setting G0 and G1 is duplicated -- for each of them. Move
the code to a separate function (vc_setGx) and distinguish the two cases
by a parameter.

Change if-else-if to switch which allows for slightly better
optimization (decision tree).

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