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.

don't pass vc->vc_par[0] to csi_?() handlers

Fetch the value directly in the helpers instead.

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

authored by

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

+19 -16
+19 -16
drivers/tty/vt/vt.c
··· 1542 1542 vc->vc_need_wrap = 0; 1543 1543 } 1544 1544 1545 - static void csi_K(struct vc_data *vc, int vpar) 1545 + static void csi_K(struct vc_data *vc) 1546 1546 { 1547 1547 unsigned int count; 1548 1548 unsigned short *start = (unsigned short *)vc->vc_pos; 1549 1549 int offset; 1550 1550 1551 - switch (vpar) { 1551 + switch (vc->vc_par[0]) { 1552 1552 case 0: /* erase from cursor to end of line */ 1553 1553 offset = 0; 1554 1554 count = vc->vc_cols - vc->state.x; ··· 1571 1571 do_update_region(vc, (unsigned long)(start + offset), count); 1572 1572 } 1573 1573 1574 - /* erase the following vpar positions */ 1575 - static void csi_X(struct vc_data *vc, unsigned int vpar) 1574 + /* erase the following count positions */ 1575 + static void csi_X(struct vc_data *vc) 1576 1576 { /* not vt100? */ 1577 - unsigned int count = clamp(vpar, 1, vc->vc_cols - vc->state.x); 1577 + unsigned int count = clamp(vc->vc_par[0], 1, vc->vc_cols - vc->state.x); 1578 1578 1579 1579 vc_uniscr_clear_line(vc, vc->state.x, count); 1580 1580 scr_memsetw((unsigned short *)vc->vc_pos, vc->vc_video_erase_char, 2 * count); ··· 2010 2010 } 2011 2011 2012 2012 /* console_lock is held */ 2013 - static void csi_L(struct vc_data *vc, unsigned int nr) 2013 + static void csi_L(struct vc_data *vc) 2014 2014 { 2015 - nr = clamp(nr, 1, vc->vc_rows - vc->state.y); 2015 + unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_rows - vc->state.y); 2016 + 2016 2017 con_scroll(vc, vc->state.y, vc->vc_bottom, SM_DOWN, nr); 2017 2018 vc->vc_need_wrap = 0; 2018 2019 } 2019 2020 2020 2021 /* console_lock is held */ 2021 - static void csi_P(struct vc_data *vc, unsigned int nr) 2022 + static void csi_P(struct vc_data *vc) 2022 2023 { 2023 - nr = clamp(nr, 1, vc->vc_cols - vc->state.x); 2024 + unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_cols - vc->state.x); 2025 + 2024 2026 delete_char(vc, nr); 2025 2027 } 2026 2028 2027 2029 /* console_lock is held */ 2028 - static void csi_M(struct vc_data *vc, unsigned int nr) 2030 + static void csi_M(struct vc_data *vc) 2029 2031 { 2030 - nr = clamp(nr, 1, vc->vc_rows - vc->state.y); 2032 + unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_rows - vc->state.y); 2033 + 2031 2034 con_scroll(vc, vc->state.y, vc->vc_bottom, SM_UP, nr); 2032 2035 vc->vc_need_wrap = 0; 2033 2036 } ··· 2433 2430 csi_J(vc, vc->vc_par[0]); 2434 2431 return; 2435 2432 case 'K': 2436 - csi_K(vc, vc->vc_par[0]); 2433 + csi_K(vc); 2437 2434 return; 2438 2435 case 'L': 2439 - csi_L(vc, vc->vc_par[0]); 2436 + csi_L(vc); 2440 2437 return; 2441 2438 case 'M': 2442 - csi_M(vc, vc->vc_par[0]); 2439 + csi_M(vc); 2443 2440 return; 2444 2441 case 'P': 2445 - csi_P(vc, vc->vc_par[0]); 2442 + csi_P(vc); 2446 2443 return; 2447 2444 case 'c': 2448 2445 if (!vc->vc_par[0]) ··· 2483 2480 restore_cur(vc); 2484 2481 return; 2485 2482 case 'X': 2486 - csi_X(vc, vc->vc_par[0]); 2483 + csi_X(vc); 2487 2484 return; 2488 2485 case '@': 2489 2486 csi_at(vc, vc->vc_par[0]);