mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
tty: vt, consw->con_scrolldelta cleanup
* allow NULL consw->con_scrolldelta (some consoles define an empty hook) * => remove empty hooks now * return value of consw->con_scrolldelta is never checked => make the function void * document consw->con_scrolldelta a bit Signed-off-by: Jiri Slaby <[email protected]> Cc: Thomas Winischhofer <[email protected]> Cc: [email protected] Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
3cc5be7739
commit
97293de977
9 changed files with 23 additions and 47 deletions
|
|
@ -72,6 +72,5 @@ const struct consw dummy_con = {
|
|||
.con_font_default = DUMMY,
|
||||
.con_font_copy = DUMMY,
|
||||
.con_set_palette = DUMMY,
|
||||
.con_scrolldelta = DUMMY,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(dummy_con);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
|
|||
static int fbcon_switch(struct vc_data *vc);
|
||||
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch);
|
||||
static int fbcon_set_palette(struct vc_data *vc, const unsigned char *table);
|
||||
static int fbcon_scrolldelta(struct vc_data *vc, int lines);
|
||||
|
||||
/*
|
||||
* Internal routines
|
||||
|
|
@ -2765,7 +2764,7 @@ static void fbcon_invert_region(struct vc_data *vc, u16 * p, int cnt)
|
|||
}
|
||||
}
|
||||
|
||||
static int fbcon_scrolldelta(struct vc_data *vc, int lines)
|
||||
static void fbcon_scrolldelta(struct vc_data *vc, int lines)
|
||||
{
|
||||
struct fb_info *info = registered_fb[con2fb_map[fg_console]];
|
||||
struct fbcon_ops *ops = info->fbcon_par;
|
||||
|
|
@ -2774,9 +2773,9 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
|
|||
|
||||
if (softback_top) {
|
||||
if (vc->vc_num != fg_console)
|
||||
return 0;
|
||||
return;
|
||||
if (vc->vc_mode != KD_TEXT || !lines)
|
||||
return 0;
|
||||
return;
|
||||
if (logo_shown >= 0) {
|
||||
struct vc_data *conp2 = vc_cons[logo_shown].d;
|
||||
|
||||
|
|
@ -2809,11 +2808,11 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
|
|||
fbcon_cursor(vc, CM_ERASE | CM_SOFTBACK);
|
||||
fbcon_redraw_softback(vc, disp, lines);
|
||||
fbcon_cursor(vc, CM_DRAW | CM_SOFTBACK);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!scrollback_phys_max)
|
||||
return -ENOSYS;
|
||||
return;
|
||||
|
||||
scrollback_old = scrollback_current;
|
||||
scrollback_current -= lines;
|
||||
|
|
@ -2822,10 +2821,10 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
|
|||
else if (scrollback_current > scrollback_max)
|
||||
scrollback_current = scrollback_max;
|
||||
if (scrollback_current == scrollback_old)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if (fbcon_is_inactive(vc, info))
|
||||
return 0;
|
||||
return;
|
||||
|
||||
fbcon_cursor(vc, CM_ERASE);
|
||||
|
||||
|
|
@ -2852,7 +2851,6 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
|
|||
|
||||
if (!scrollback_current)
|
||||
fbcon_cursor(vc, CM_DRAW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fbcon_set_origin(struct vc_data *vc)
|
||||
|
|
|
|||
|
|
@ -505,11 +505,6 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
|
|||
}
|
||||
}
|
||||
|
||||
static int mdacon_scrolldelta(struct vc_data *c, int lines)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mdacon_cursor(struct vc_data *c, int mode)
|
||||
{
|
||||
if (mode == CM_ERASE) {
|
||||
|
|
@ -578,7 +573,6 @@ static const struct consw mda_con = {
|
|||
.con_switch = mdacon_switch,
|
||||
.con_blank = mdacon_blank,
|
||||
.con_set_palette = mdacon_set_palette,
|
||||
.con_scrolldelta = mdacon_scrolldelta,
|
||||
.con_build_attr = mdacon_build_attr,
|
||||
.con_invert_region = mdacon_invert_region,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -579,12 +579,6 @@ static int newport_set_palette(struct vc_data *vc, const unsigned char *table)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int newport_scrolldelta(struct vc_data *vc, int lines)
|
||||
{
|
||||
/* there is (nearly) no off-screen memory, so we can't scroll back */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int newport_scroll(struct vc_data *vc, int t, int b, int dir,
|
||||
int lines)
|
||||
{
|
||||
|
|
@ -735,7 +729,6 @@ const struct consw newport_con = {
|
|||
.con_font_set = newport_font_set,
|
||||
.con_font_default = newport_font_default,
|
||||
.con_set_palette = newport_set_palette,
|
||||
.con_scrolldelta = newport_scrolldelta,
|
||||
.con_set_origin = DUMMY,
|
||||
.con_save_screen = DUMMY
|
||||
};
|
||||
|
|
|
|||
|
|
@ -256,11 +256,6 @@ static int sticon_blank(struct vc_data *c, int blank, int mode_switch)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int sticon_scrolldelta(struct vc_data *conp, int lines)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u16 *sticon_screen_pos(struct vc_data *conp, int offset)
|
||||
{
|
||||
int line;
|
||||
|
|
@ -359,7 +354,6 @@ static const struct consw sti_con = {
|
|||
.con_switch = sticon_switch,
|
||||
.con_blank = sticon_blank,
|
||||
.con_set_palette = sticon_set_palette,
|
||||
.con_scrolldelta = sticon_scrolldelta,
|
||||
.con_set_origin = sticon_set_origin,
|
||||
.con_save_screen = sticon_save_screen,
|
||||
.con_build_attr = sticon_build_attr,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static void vgacon_deinit(struct vc_data *c);
|
|||
static void vgacon_cursor(struct vc_data *c, int mode);
|
||||
static int vgacon_switch(struct vc_data *c);
|
||||
static int vgacon_blank(struct vc_data *c, int blank, int mode_switch);
|
||||
static int vgacon_scrolldelta(struct vc_data *c, int lines);
|
||||
static void vgacon_scrolldelta(struct vc_data *c, int lines);
|
||||
static int vgacon_set_origin(struct vc_data *c);
|
||||
static void vgacon_save_screen(struct vc_data *c);
|
||||
static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
|
||||
|
|
@ -248,18 +248,18 @@ static void vgacon_restore_screen(struct vc_data *c)
|
|||
}
|
||||
}
|
||||
|
||||
static int vgacon_scrolldelta(struct vc_data *c, int lines)
|
||||
static void vgacon_scrolldelta(struct vc_data *c, int lines)
|
||||
{
|
||||
int start, end, count, soff;
|
||||
|
||||
if (!lines) {
|
||||
c->vc_visible_origin = c->vc_origin;
|
||||
vga_set_mem_top(c);
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!vgacon_scrollback)
|
||||
return 1;
|
||||
return;
|
||||
|
||||
if (!vgacon_scrollback_save) {
|
||||
vgacon_cursor(c, CM_ERASE);
|
||||
|
|
@ -320,8 +320,6 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
|
|||
scr_memcpyw(d, s, diff * c->vc_size_row);
|
||||
} else
|
||||
vgacon_cursor(c, CM_MOVE);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#define vgacon_scrollback_startup(...) do { } while (0)
|
||||
|
|
@ -334,7 +332,7 @@ static void vgacon_restore_screen(struct vc_data *c)
|
|||
vgacon_scrolldelta(c, 0);
|
||||
}
|
||||
|
||||
static int vgacon_scrolldelta(struct vc_data *c, int lines)
|
||||
static void vgacon_scrolldelta(struct vc_data *c, int lines)
|
||||
{
|
||||
if (!lines) /* Turn scrollback off */
|
||||
c->vc_visible_origin = c->vc_origin;
|
||||
|
|
@ -362,7 +360,6 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
|
|||
c->vc_visible_origin = vga_vram_base + (p + ul) % we;
|
||||
}
|
||||
vga_set_mem_top(c);
|
||||
return 1;
|
||||
}
|
||||
#endif /* CONFIG_VGACON_SOFT_SCROLLBACK */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue