diff options
Diffstat (limited to 'drivers/video/console/vgacon.c')
-rw-r--r-- | drivers/video/console/vgacon.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 3556268fe0a0..448d209a0bf2 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -239,8 +239,7 @@ static void vgacon_restore_screen(struct vc_data *c) | |||
239 | 239 | ||
240 | static int vgacon_scrolldelta(struct vc_data *c, int lines) | 240 | static int vgacon_scrolldelta(struct vc_data *c, int lines) |
241 | { | 241 | { |
242 | int start, end, count, soff, diff; | 242 | int start, end, count, soff; |
243 | void *d, *s; | ||
244 | 243 | ||
245 | if (!lines) { | 244 | if (!lines) { |
246 | c->vc_visible_origin = c->vc_origin; | 245 | c->vc_visible_origin = c->vc_origin; |
@@ -287,13 +286,13 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines) | |||
287 | if (count > c->vc_rows) | 286 | if (count > c->vc_rows) |
288 | count = c->vc_rows; | 287 | count = c->vc_rows; |
289 | 288 | ||
290 | diff = c->vc_rows - count; | ||
291 | |||
292 | d = (void *) c->vc_origin; | ||
293 | s = (void *) c->vc_screenbuf; | ||
294 | |||
295 | if (count) { | 289 | if (count) { |
296 | int copysize; | 290 | int copysize; |
291 | |||
292 | int diff = c->vc_rows - count; | ||
293 | void *d = (void *) c->vc_origin; | ||
294 | void *s = (void *) c->vc_screenbuf; | ||
295 | |||
297 | count *= c->vc_size_row; | 296 | count *= c->vc_size_row; |
298 | /* how much memory to end of buffer left? */ | 297 | /* how much memory to end of buffer left? */ |
299 | copysize = min(count, vgacon_scrollback_size - soff); | 298 | copysize = min(count, vgacon_scrollback_size - soff); |
@@ -305,14 +304,11 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines) | |||
305 | scr_memcpyw(d, vgacon_scrollback, count); | 304 | scr_memcpyw(d, vgacon_scrollback, count); |
306 | d += count; | 305 | d += count; |
307 | } | 306 | } |
308 | } | ||
309 | 307 | ||
310 | if (diff == c->vc_rows) { | ||
311 | vgacon_cursor(c, CM_MOVE); | ||
312 | } else { | ||
313 | if (diff) | 308 | if (diff) |
314 | scr_memcpyw(d, s, diff * c->vc_size_row); | 309 | scr_memcpyw(d, s, diff * c->vc_size_row); |
315 | } | 310 | } else |
311 | vgacon_cursor(c, CM_MOVE); | ||
316 | 312 | ||
317 | return 1; | 313 | return 1; |
318 | } | 314 | } |