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+J codes

Decrypt the constant values by proper enum names. This time in csi_J().

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-12-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
4b8f9361 76ec3a7a

+15 -8
+15 -8
drivers/tty/vt/vt.c
··· 1498 1498 /* ignored */ 1499 1499 } 1500 1500 1501 - static void csi_J(struct vc_data *vc, int vpar) 1501 + enum CSI_J { 1502 + CSI_J_CURSOR_TO_END = 0, 1503 + CSI_J_START_TO_CURSOR = 1, 1504 + CSI_J_VISIBLE = 2, 1505 + CSI_J_FULL = 3, 1506 + }; 1507 + 1508 + static void csi_J(struct vc_data *vc, enum CSI_J vpar) 1502 1509 { 1503 1510 unsigned int count; 1504 1511 unsigned short * start; 1505 1512 1506 1513 switch (vpar) { 1507 - case 0: /* erase from cursor to end of display */ 1514 + case CSI_J_CURSOR_TO_END: 1508 1515 vc_uniscr_clear_line(vc, vc->state.x, 1509 1516 vc->vc_cols - vc->state.x); 1510 1517 vc_uniscr_clear_lines(vc, vc->state.y + 1, ··· 1519 1512 count = (vc->vc_scr_end - vc->vc_pos) >> 1; 1520 1513 start = (unsigned short *)vc->vc_pos; 1521 1514 break; 1522 - case 1: /* erase from start to cursor */ 1515 + case CSI_J_START_TO_CURSOR: 1523 1516 vc_uniscr_clear_line(vc, 0, vc->state.x + 1); 1524 1517 vc_uniscr_clear_lines(vc, 0, vc->state.y); 1525 1518 count = ((vc->vc_pos - vc->vc_origin) >> 1) + 1; 1526 1519 start = (unsigned short *)vc->vc_origin; 1527 1520 break; 1528 - case 3: /* include scrollback */ 1521 + case CSI_J_FULL: 1529 1522 flush_scrollback(vc); 1530 1523 fallthrough; 1531 - case 2: /* erase whole display */ 1524 + case CSI_J_VISIBLE: 1532 1525 vc_uniscr_clear_lines(vc, 0, vc->vc_rows); 1533 1526 count = vc->vc_cols * vc->vc_rows; 1534 1527 start = (unsigned short *)vc->vc_origin; ··· 2117 2110 gotoxy(vc, 0, 0); 2118 2111 save_cur(vc); 2119 2112 if (do_clear) 2120 - csi_J(vc, 2); 2113 + csi_J(vc, CSI_J_VISIBLE); 2121 2114 } 2122 2115 2123 2116 static void vc_setGx(struct vc_data *vc, unsigned int which, int c) ··· 2533 2526 /* DEC screen alignment test. kludge :-) */ 2534 2527 vc->vc_video_erase_char = 2535 2528 (vc->vc_video_erase_char & 0xff00) | 'E'; 2536 - csi_J(vc, 2); 2529 + csi_J(vc, CSI_J_VISIBLE); 2537 2530 vc->vc_video_erase_char = 2538 2531 (vc->vc_video_erase_char & 0xff00) | ' '; 2539 2532 do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2); ··· 3505 3498 set_origin(vc); 3506 3499 save_screen(vc); 3507 3500 gotoxy(vc, vc->state.x, vc->state.y); 3508 - csi_J(vc, 0); 3501 + csi_J(vc, CSI_J_CURSOR_TO_END); 3509 3502 update_screen(vc); 3510 3503 pr_info("Console: %s %s %dx%d\n", 3511 3504 vc->vc_can_do_color ? "colour" : "mono",