Commit f0e8e3da authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

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: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200316065911.11024-2-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85af3705
...@@ -252,9 +252,9 @@ static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct * ...@@ -252,9 +252,9 @@ static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct *
} }
break; break;
case TIOCL_SELLINE: /* line-by-line selection */ case TIOCL_SELLINE: /* line-by-line selection */
new_sel_start = ps - ps % vc->vc_size_row; new_sel_start = rounddown(ps, vc->vc_size_row);
new_sel_end = pe + vc->vc_size_row new_sel_end = rounddown(pe, vc->vc_size_row) +
- pe % vc->vc_size_row - 2; vc->vc_size_row - 2;
break; break;
case TIOCL_SELPOINTER: case TIOCL_SELPOINTER:
highlight_pointer(pe); highlight_pointer(pe);
......
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