aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2016-10-03 05:18:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-27 10:37:44 -0400
commit7c918cdceb32c50b3f4a31eec177076c9a151b35 (patch)
tree160622e3e45eb56a4592fb56ace0cca397311215 /drivers/tty
parent210fd7460e755c6de4972bca4ffa9cd9580279aa (diff)
tty: vt, rename variables to sane names
This makes the code understandable at least. No functional changes. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/vt/vt.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 3cb6504b41d3..804cc3151b13 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -4287,7 +4287,7 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines,
4287 ptrdiff_t vorigin = (void *)c->vc_visible_origin - base; 4287 ptrdiff_t vorigin = (void *)c->vc_visible_origin - base;
4288 ptrdiff_t origin = (void *)c->vc_origin - base; 4288 ptrdiff_t origin = (void *)c->vc_origin - base;
4289 int margin = c->vc_size_row * 4; 4289 int margin = c->vc_size_row * 4;
4290 int ul, we, p, st; 4290 int from, wrap, from_off, avail;
4291 4291
4292 /* Turn scrollback off */ 4292 /* Turn scrollback off */
4293 if (!lines) { 4293 if (!lines) {
@@ -4297,25 +4297,25 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines,
4297 4297
4298 /* Do we have already enough to allow jumping from 0 to the end? */ 4298 /* Do we have already enough to allow jumping from 0 to the end? */
4299 if (rolled_over > scr_end + margin) { 4299 if (rolled_over > scr_end + margin) {
4300 ul = scr_end; 4300 from = scr_end;
4301 we = rolled_over + c->vc_size_row; 4301 wrap = rolled_over + c->vc_size_row;
4302 } else { 4302 } else {
4303 ul = 0; 4303 from = 0;
4304 we = size; 4304 wrap = size;
4305 } 4305 }
4306 4306
4307 p = (vorigin - ul + we) % we + lines * c->vc_size_row; 4307 from_off = (vorigin - from + wrap) % wrap + lines * c->vc_size_row;
4308 st = (origin - ul + we) % we; 4308 avail = (origin - from + wrap) % wrap;
4309 4309
4310 /* Only a little piece would be left? Show all incl. the piece! */ 4310 /* Only a little piece would be left? Show all incl. the piece! */
4311 if (st < 2 * margin) 4311 if (avail < 2 * margin)
4312 margin = 0; 4312 margin = 0;
4313 if (p < margin) 4313 if (from_off < margin)
4314 p = 0; 4314 from_off = 0;
4315 if (p > st - margin) 4315 if (from_off > avail - margin)
4316 p = st; 4316 from_off = avail;
4317 4317
4318 c->vc_visible_origin = ubase + (p + ul) % we; 4318 c->vc_visible_origin = ubase + (from + from_off) % wrap;
4319} 4319}
4320EXPORT_SYMBOL_GPL(vc_scrolldelta_helper); 4320EXPORT_SYMBOL_GPL(vc_scrolldelta_helper);
4321 4321