diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2024-01-22 12:03:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-28 03:08:53 +0100 |
commit | 7eb38a765e347baa89a2e72050866ebdb4377cb9 (patch) | |
tree | 1f2ae71dc917c0df2c477de3027e599db9fa049f /drivers/tty/vt | |
parent | don't pass vc->vc_par[0] to csi_?() handlers (diff) | |
download | linux-7eb38a765e347baa89a2e72050866ebdb4377cb9.tar.xz linux-7eb38a765e347baa89a2e72050866ebdb4377cb9.zip |
tty: vt: define an enum for CSI+K codes
Decrypt the constant values by proper enum names. This time in csi_K().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-16-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, 9 insertions, 3 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 16ba3a3666ab..2f3f5e4817f6 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1542,6 +1542,12 @@ static void csi_J(struct vc_data *vc, enum CSI_J vpar) vc->vc_need_wrap = 0; } +enum { + CSI_K_CURSOR_TO_LINEEND = 0, + CSI_K_LINESTART_TO_CURSOR = 1, + CSI_K_LINE = 2, +}; + static void csi_K(struct vc_data *vc) { unsigned int count; @@ -1549,15 +1555,15 @@ static void csi_K(struct vc_data *vc) int offset; switch (vc->vc_par[0]) { - case 0: /* erase from cursor to end of line */ + case CSI_K_CURSOR_TO_LINEEND: offset = 0; count = vc->vc_cols - vc->state.x; break; - case 1: /* erase from start of line to cursor */ + case CSI_K_LINESTART_TO_CURSOR: offset = -vc->state.x; count = vc->state.x + 1; break; - case 2: /* erase whole line */ + case CSI_K_LINE: offset = -vc->state.x; count = vc->vc_cols; break; |