aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/mdacon.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/mdacon.c
parentserial: 8250_fintek: Add F81865 Support (diff)
downloadlinux-dev-d705ff38189fcfbbfa6aa97363d30c23348ad166.tar.xz
linux-dev-d705ff38189fcfbbfa6aa97363d30c23348ad166.zip
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/mdacon.c')
-rw-r--r--drivers/video/console/mdacon.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index bacbb044d77c..ec192a1bf297 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -488,12 +488,13 @@ static void mdacon_cursor(struct vc_data *c, int mode)
}
}
-static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
+static bool mdacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
+ enum con_scroll dir, unsigned int lines)
{
u16 eattr = mda_convert_attr(c->vc_video_erase_char);
if (!lines)
- return 0;
+ return false;
if (lines > c->vc_rows) /* maximum realistic size */
lines = c->vc_rows;
@@ -514,7 +515,7 @@ static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
break;
}
- return 0;
+ return false;
}