diff options
author | Jiri Slaby <jslaby@suse.cz> | 2020-06-15 10:48:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-24 18:08:33 +0300 |
commit | e8548296d27fc5944e4d98f830dc0cb71a9da5e5 (patch) | |
tree | b001a03c32e1dd3e79b9acc36dd699e737f3b653 /drivers/tty/vt/vt.c | |
parent | f1bcbe141381a9f715f90d61003d6b47fe084d04 (diff) | |
download | linux-e8548296d27fc5944e4d98f830dc0cb71a9da5e5.tar.xz |
vt: synchronize types and use min in csi_X
All the types are unsinged ints -- even the vpar passed to the function.
So unify them and use min() to compute count instead of explicit
comparison.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200615074910.19267-23-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r-- | drivers/tty/vt/vt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 4686f8b9251d..b1fdbf119755 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1582,13 +1582,15 @@ static void csi_K(struct vc_data *vc, int vpar) do_update_region(vc, (unsigned long)(start + offset), count); } -static void csi_X(struct vc_data *vc, int vpar) /* erase the following vpar positions */ +/* erase the following vpar positions */ +static void csi_X(struct vc_data *vc, unsigned int vpar) { /* not vt100? */ - int count; + unsigned int count; if (!vpar) vpar++; - count = (vpar > vc->vc_cols - vc->state.x) ? (vc->vc_cols - vc->state.x) : vpar; + + count = min(vpar, vc->vc_cols - vc->state.x); vc_uniscr_clear_line(vc, vc->state.x, count); scr_memsetw((unsigned short *)vc->vc_pos, vc->vc_video_erase_char, 2 * count); |