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>
This commit is contained in:
Jiri Slaby
2016-10-03 11:18:33 +02:00
committed by Greg Kroah-Hartman
부모 de48b0999d
커밋 d705ff3818
8개의 변경된 파일50개의 추가작업 그리고 42개의 파일을 삭제

파일 보기

@@ -315,7 +315,8 @@ void schedule_console_callback(void)
schedule_work(&console_work);
}
static void scrup(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
static void scrup(struct vc_data *vc, unsigned int t, unsigned int b,
unsigned int nr)
{
unsigned short *d, *s;
@@ -332,7 +333,8 @@ static void scrup(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
vc->vc_size_row * nr);
}
static void scrdown(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
static void scrdown(struct vc_data *vc, unsigned int t, unsigned int b,
unsigned int nr)
{
unsigned short *s;
unsigned int step;