tty: vt: simplify ansi_control_string()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Fri, 2 Feb 2024 06:56:02 +0000 (07:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Feb 2024 14:37:39 +0000 (14:37 +0000)
commitfd5b40251a02f7652adba88bc09802fcff004a7f
treee249ef1cde52fbf1b1544e7b5f320488a7d64e91
parent22795b3c4738849283c63274c6af98b9d28c4c3c
tty: vt: simplify ansi_control_string()

Given all the ANSI control states are sequential in the vc_ctl_state
enum, we can define first/last constants and use them in
ansi_control_string(). It makes the test simple and allows for removal
of the 'if' (which was unnecessary at all -- the 'return' should have
returned the 'if' content directly anyway).

And remove the useless comment -- it's clear from the function
prototype.

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