diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2024-02-02 09:56:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-06 17:37:39 +0300 |
commit | 137eb9ad22bf2b2e0e613afc076e5f51390954ad (patch) | |
tree | aa7d887f935724dbad7585958e9945522ee259cf /drivers/tty/vt | |
parent | 3d5f5b9711e46800d7e602e95f26698cc6ff2ed3 (diff) | |
download | linux-137eb9ad22bf2b2e0e613afc076e5f51390954ad.tar.xz |
tty: vt: use switch+case in the ESgetpars case
To be uniform in the 'c' handling, use switch-case (with ranges) even in
the ESgetpars case in do_con_trol().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20240202065608.14019-21-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r-- | drivers/tty/vt/vt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index b5fc3b896e26..b3c61ec92df9 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2628,10 +2628,14 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, u8 c) vc->vc_priv = EPecma; fallthrough; case ESgetpars: /* ESC [ aka CSI, parameters expected */ - if (c == ';' && vc->vc_npar < NPAR - 1) { - vc->vc_npar++; - return; - } else if (c>='0' && c<='9') { + switch (c) { + case ';': + if (vc->vc_npar < NPAR - 1) { + vc->vc_npar++; + return; + } + break; + case '0' ... '9': vc->vc_par[vc->vc_npar] *= 10; vc->vc_par[vc->vc_npar] += c - '0'; return; |