summaryrefslogtreecommitdiffstats
path: root/drivers/video/console/vgacon.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2016-10-03 11:18:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-27 16:37:43 +0200
commitd705ff38189fcfbbfa6aa97363d30c23348ad166 (patch)
tree48b1720feab3c44d79b2d4cdfdc13c82941c1f2e /drivers/video/console/vgacon.c
parentde48b0999df44b5d2ab75500a48aedff5a36f0e6 (diff)
downloadop-kernel-dev-d705ff38189fcfbbfa6aa97363d30c23348ad166.zip
op-kernel-dev-d705ff38189fcfbbfa6aa97363d30c23348ad166.tar.gz
tty: vt, cleanup and document con_scroll
Scrolling helpers scrup and scrdown both accept 'top' and 'bottom' as unsigned int. Number of lines 'nr' is accepted as int, but all callers pass down unsigned too. So change the type of 'nr' to unsigned too. Now, promote unsigned int from the helpers up to the con_scroll hook which actually accepted all those as signed int. Next, the 'dir' parameter can have only two values and we define constants for that: SM_UP and SM_DOWN. Switch them to enum and do proper type checking on 'dir' too. Finally, document the behaviour of the hook. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: <linux-fbdev@vger.kernel.org> Cc: <linux-usb@vger.kernel.org> Cc: <linux-parisc@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video/console/vgacon.c')
-rw-r--r--drivers/video/console/vgacon.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 1157661..4c54a87 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -83,8 +83,6 @@ static int vgacon_blank(struct vc_data *c, int blank, int mode_switch);
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,
- int lines);
static void vgacon_invert_region(struct vc_data *c, u16 * p, int count);
static struct uni_pagedir *vgacon_uni_pagedir;
static int vgacon_refcount;
@@ -1350,17 +1348,17 @@ static void vgacon_save_screen(struct vc_data *c)
c->vc_screenbuf_size > vga_vram_size ? vga_vram_size : c->vc_screenbuf_size);
}
-static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
- int lines)
+static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
+ enum con_scroll dir, unsigned int lines)
{
unsigned long oldo;
unsigned int delta;
if (t || b != c->vc_rows || vga_is_gfx || c->vc_mode != KD_TEXT)
- return 0;
+ return false;
if (!vga_hardscroll_enabled || lines >= c->vc_rows / 2)
- return 0;
+ return false;
vgacon_restore_screen(c);
oldo = c->vc_origin;
@@ -1396,7 +1394,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
c->vc_visible_origin = c->vc_origin;
vga_set_mem_top(c);
c->vc_pos = (c->vc_pos - oldo) + c->vc_origin;
- return 1;
+ return true;
}
OpenPOWER on IntegriCloud