diff options
author | Jiri Slaby <jslaby@suse.cz> | 2020-03-16 09:59:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-16 10:41:17 +0300 |
commit | f0e8e3da22abd0015348760b2ea26bf45fdf3030 (patch) | |
tree | 64494087da8d3c8c13ed9d8dff01194f5aea3b46 /drivers/tty | |
parent | 85af37056a72c5e2e5758a44c94c78cbdf3658e3 (diff) | |
download | linux-f0e8e3da22abd0015348760b2ea26bf45fdf3030.tar.xz |
vt: selection, use rounddown() for start/endline computation
We have a helper called rounddown for these modulo computations. So use
it.
No functional change intended and "objdump -d" proves that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200316065911.11024-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/vt/selection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c index 582184dd386c..d54a549c5892 100644 --- a/drivers/tty/vt/selection.c +++ b/drivers/tty/vt/selection.c @@ -252,9 +252,9 @@ static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct * } break; case TIOCL_SELLINE: /* line-by-line selection */ - new_sel_start = ps - ps % vc->vc_size_row; - new_sel_end = pe + vc->vc_size_row - - pe % vc->vc_size_row - 2; + new_sel_start = rounddown(ps, vc->vc_size_row); + new_sel_end = rounddown(pe, vc->vc_size_row) + + vc->vc_size_row - 2; break; case TIOCL_SELPOINTER: highlight_pointer(pe); |