Commit 8e6bd49a authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman

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

Fetch the value directly in the helpers instead.
Signed-off-by: default avatar"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.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb881eba
...@@ -1542,13 +1542,13 @@ static void csi_J(struct vc_data *vc, enum CSI_J vpar) ...@@ -1542,13 +1542,13 @@ static void csi_J(struct vc_data *vc, enum CSI_J vpar)
vc->vc_need_wrap = 0; vc->vc_need_wrap = 0;
} }
static void csi_K(struct vc_data *vc, int vpar) static void csi_K(struct vc_data *vc)
{ {
unsigned int count; unsigned int count;
unsigned short *start = (unsigned short *)vc->vc_pos; unsigned short *start = (unsigned short *)vc->vc_pos;
int offset; int offset;
switch (vpar) { switch (vc->vc_par[0]) {
case 0: /* erase from cursor to end of line */ case 0: /* erase from cursor to end of line */
offset = 0; offset = 0;
count = vc->vc_cols - vc->state.x; count = vc->vc_cols - vc->state.x;
...@@ -1571,10 +1571,10 @@ static void csi_K(struct vc_data *vc, int vpar) ...@@ -1571,10 +1571,10 @@ static void csi_K(struct vc_data *vc, int vpar)
do_update_region(vc, (unsigned long)(start + offset), count); do_update_region(vc, (unsigned long)(start + offset), count);
} }
/* erase the following vpar positions */ /* erase the following count positions */
static void csi_X(struct vc_data *vc, unsigned int vpar) static void csi_X(struct vc_data *vc)
{ /* not vt100? */ { /* not vt100? */
unsigned int count = clamp(vpar, 1, vc->vc_cols - vc->state.x); unsigned int count = clamp(vc->vc_par[0], 1, vc->vc_cols - vc->state.x);
vc_uniscr_clear_line(vc, vc->state.x, count); vc_uniscr_clear_line(vc, vc->state.x, count);
scr_memsetw((unsigned short *)vc->vc_pos, vc->vc_video_erase_char, 2 * count); scr_memsetw((unsigned short *)vc->vc_pos, vc->vc_video_erase_char, 2 * count);
...@@ -2010,24 +2010,27 @@ static void csi_at(struct vc_data *vc, unsigned int nr) ...@@ -2010,24 +2010,27 @@ static void csi_at(struct vc_data *vc, unsigned int nr)
} }
/* console_lock is held */ /* console_lock is held */
static void csi_L(struct vc_data *vc, unsigned int nr) static void csi_L(struct vc_data *vc)
{ {
nr = clamp(nr, 1, vc->vc_rows - vc->state.y); unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_rows - vc->state.y);
con_scroll(vc, vc->state.y, vc->vc_bottom, SM_DOWN, nr); con_scroll(vc, vc->state.y, vc->vc_bottom, SM_DOWN, nr);
vc->vc_need_wrap = 0; vc->vc_need_wrap = 0;
} }
/* console_lock is held */ /* console_lock is held */
static void csi_P(struct vc_data *vc, unsigned int nr) static void csi_P(struct vc_data *vc)
{ {
nr = clamp(nr, 1, vc->vc_cols - vc->state.x); unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_cols - vc->state.x);
delete_char(vc, nr); delete_char(vc, nr);
} }
/* console_lock is held */ /* console_lock is held */
static void csi_M(struct vc_data *vc, unsigned int nr) static void csi_M(struct vc_data *vc)
{ {
nr = clamp(nr, 1, vc->vc_rows - vc->state.y); unsigned int nr = clamp(vc->vc_par[0], 1, vc->vc_rows - vc->state.y);
con_scroll(vc, vc->state.y, vc->vc_bottom, SM_UP, nr); con_scroll(vc, vc->state.y, vc->vc_bottom, SM_UP, nr);
vc->vc_need_wrap = 0; vc->vc_need_wrap = 0;
} }
...@@ -2430,16 +2433,16 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) ...@@ -2430,16 +2433,16 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
csi_J(vc, vc->vc_par[0]); csi_J(vc, vc->vc_par[0]);
return; return;
case 'K': case 'K':
csi_K(vc, vc->vc_par[0]); csi_K(vc);
return; return;
case 'L': case 'L':
csi_L(vc, vc->vc_par[0]); csi_L(vc);
return; return;
case 'M': case 'M':
csi_M(vc, vc->vc_par[0]); csi_M(vc);
return; return;
case 'P': case 'P':
csi_P(vc, vc->vc_par[0]); csi_P(vc);
return; return;
case 'c': case 'c':
if (!vc->vc_par[0]) if (!vc->vc_par[0])
...@@ -2480,7 +2483,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) ...@@ -2480,7 +2483,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
restore_cur(vc); restore_cur(vc);
return; return;
case 'X': case 'X':
csi_X(vc, vc->vc_par[0]); csi_X(vc);
return; return;
case '@': case '@':
csi_at(vc, vc->vc_par[0]); csi_at(vc, vc->vc_par[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment