Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
7eb38a76 8e6bd49a

+9 -3
+9 -3
drivers/tty/vt/vt.c
··· 1542 1542 vc->vc_need_wrap = 0; 1543 1543 } 1544 1544 1545 + enum { 1546 + CSI_K_CURSOR_TO_LINEEND = 0, 1547 + CSI_K_LINESTART_TO_CURSOR = 1, 1548 + CSI_K_LINE = 2, 1549 + }; 1550 + 1545 1551 static void csi_K(struct vc_data *vc) 1546 1552 { 1547 1553 unsigned int count; ··· 1555 1549 int offset; 1556 1550 1557 1551 switch (vc->vc_par[0]) { 1558 - case 0: /* erase from cursor to end of line */ 1552 + case CSI_K_CURSOR_TO_LINEEND: 1559 1553 offset = 0; 1560 1554 count = vc->vc_cols - vc->state.x; 1561 1555 break; 1562 - case 1: /* erase from start of line to cursor */ 1556 + case CSI_K_LINESTART_TO_CURSOR: 1563 1557 offset = -vc->state.x; 1564 1558 count = vc->state.x + 1; 1565 1559 break; 1566 - case 2: /* erase whole line */ 1560 + case CSI_K_LINE: 1567 1561 offset = -vc->state.x; 1568 1562 count = vc->vc_cols; 1569 1563 break;