projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85af370
)
vt: selection, use rounddown() for start/endline computation
author
Jiri Slaby
<jslaby@suse.cz>
Mon, 16 Mar 2020 06:59:10 +0000
(07:59 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 16 Mar 2020 07:41:17 +0000
(08:41 +0100)
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>
drivers/tty/vt/selection.c
patch
|
blob
|
history
diff --git
a/drivers/tty/vt/selection.c
b/drivers/tty/vt/selection.c
index 582184dd386caf5ea91cebb775c20c067e197249..d54a549c58920512c080ac76ce0c2e5cd4bcce74 100644
(file)
--- 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);