提交 7c918cdc 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

tty: vt, rename variables to sane names

This makes the code understandable at least. No functional changes.
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 210fd746
...@@ -4287,7 +4287,7 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines, ...@@ -4287,7 +4287,7 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines,
ptrdiff_t vorigin = (void *)c->vc_visible_origin - base; ptrdiff_t vorigin = (void *)c->vc_visible_origin - base;
ptrdiff_t origin = (void *)c->vc_origin - base; ptrdiff_t origin = (void *)c->vc_origin - base;
int margin = c->vc_size_row * 4; int margin = c->vc_size_row * 4;
int ul, we, p, st; int from, wrap, from_off, avail;
/* Turn scrollback off */ /* Turn scrollback off */
if (!lines) { if (!lines) {
...@@ -4297,25 +4297,25 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines, ...@@ -4297,25 +4297,25 @@ void vc_scrolldelta_helper(struct vc_data *c, int lines,
/* Do we have already enough to allow jumping from 0 to the end? */ /* Do we have already enough to allow jumping from 0 to the end? */
if (rolled_over > scr_end + margin) { if (rolled_over > scr_end + margin) {
ul = scr_end; from = scr_end;
we = rolled_over + c->vc_size_row; wrap = rolled_over + c->vc_size_row;
} else { } else {
ul = 0; from = 0;
we = size; wrap = size;
} }
p = (vorigin - ul + we) % we + lines * c->vc_size_row; from_off = (vorigin - from + wrap) % wrap + lines * c->vc_size_row;
st = (origin - ul + we) % we; avail = (origin - from + wrap) % wrap;
/* Only a little piece would be left? Show all incl. the piece! */ /* Only a little piece would be left? Show all incl. the piece! */
if (st < 2 * margin) if (avail < 2 * margin)
margin = 0; margin = 0;
if (p < margin) if (from_off < margin)
p = 0; from_off = 0;
if (p > st - margin) if (from_off > avail - margin)
p = st; from_off = avail;
c->vc_visible_origin = ubase + (p + ul) % we; c->vc_visible_origin = ubase + (from + from_off) % wrap;
} }
EXPORT_SYMBOL_GPL(vc_scrolldelta_helper); EXPORT_SYMBOL_GPL(vc_scrolldelta_helper);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册